diff options
author | George Hazan <george.hazan@gmail.com> | 2012-05-30 13:54:56 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-05-30 13:54:56 +0000 |
commit | ee9d85e617be7be900d31be00d0dec766119c2e5 (patch) | |
tree | fcc7a837d39e057a79bae3b9509bef659f1643f2 /protocols/JabberG/jabber_groupchat.cpp | |
parent | 9951afcf3b7dbb6ec2037dcb345c56db811329cd (diff) |
yet another option for chats' history reading
git-svn-id: http://svn.miranda-ng.org/main/trunk@233 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/jabber_groupchat.cpp')
-rw-r--r-- | protocols/JabberG/jabber_groupchat.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/protocols/JabberG/jabber_groupchat.cpp b/protocols/JabberG/jabber_groupchat.cpp index eb2ae55adb..8e11f030cf 100644 --- a/protocols/JabberG/jabber_groupchat.cpp +++ b/protocols/JabberG/jabber_groupchat.cpp @@ -320,19 +320,19 @@ void CJabberProto::GroupchatJoinRoom( const TCHAR* server, const TCHAR* room, co if ( info.password && info.password[0] )
x << XCHILD( _T("password"), info.password );
- char setting[MAXMODULELABELLENGTH];
- DBVARIANT dbv;
- mir_snprintf(setting, sizeof(setting), "muc_%s@%s_lastevent", mir_u2a(room), mir_u2a(server));
- time_t lasteventtime = this->JGetDword( NULL, setting, 0 );
- if ( lasteventtime > 0 ) {
- _tzset();
- lasteventtime += _timezone + 1;
- struct tm* time = localtime(&lasteventtime);
- TCHAR lasteventdate[20];
- TCHAR* timeformat = mir_a2u("%04d-%02d-%02dT%02d:%02d:%02dZ");
- mir_sntprintf(lasteventdate, sizeof(lasteventdate), timeformat, time->tm_year+1900, time->tm_mon+1, time->tm_mday, time->tm_hour, time->tm_min, time->tm_sec);
- x << XCHILD( _T("history") ) << XATTR( _T("since"), lasteventdate);
- JFreeVariant( &dbv );
+ if (m_options.GcLogChatHistory) {
+ char setting[MAXMODULELABELLENGTH];
+ mir_snprintf(setting, SIZEOF(setting), "muc_%s@%s_lastevent", _T2A(room), _T2A(server));
+ time_t lasteventtime = this->JGetDword( NULL, setting, 0 );
+ if ( lasteventtime > 0 ) {
+ _tzset();
+ lasteventtime += _timezone + 1;
+ struct tm* time = localtime(&lasteventtime);
+ TCHAR lasteventdate[20];
+ mir_sntprintf(lasteventdate, SIZEOF(lasteventdate), _T("%04d-%02d-%02dT%02d:%02d:%02dZ"),
+ time->tm_year+1900, time->tm_mon+1, time->tm_mday, time->tm_hour, time->tm_min, time->tm_sec);
+ x << XCHILD( _T("history") ) << XATTR( _T("since"), lasteventdate);
+ }
}
SendPresenceTo( status, text, x );
@@ -1250,9 +1250,9 @@ void CJabberProto::GroupchatProcessMessage( HXML node ) if ( !_tcscmp( p, _T("jabber:x:delay")) && msgTime==0 )
if (( p = xmlGetAttrValue( xNode, _T("stamp"))) != NULL ) {
msgTime = JabberIsoToUnixTime( p );
- if ( msgTime > 0 ) {
+ if (m_options.GcLogChatHistory && msgTime > 0 ) {
char setting[MAXMODULELABELLENGTH];
- mir_snprintf(setting, sizeof(setting), "muc_%s_lastevent", mir_u2a(gcd.ptszID));
+ mir_snprintf(setting, sizeof(setting), "muc_%s_lastevent", _T2A(gcd.ptszID));
this->JSetDword(NULL, setting, msgTime);
} }
|