From 01a38512a17fc0f08fca08e9fb8d4edfd0d061df Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Tue, 5 Apr 2011 07:44:13 +0300 Subject: modified: messages.cpp modified: utilities.cpp modified: utilities.h --- messages.cpp | 55 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 27 deletions(-) (limited to 'messages.cpp') diff --git a/messages.cpp b/messages.cpp index 51bd113..f73223e 100644 --- a/messages.cpp +++ b/messages.cpp @@ -23,7 +23,7 @@ boost::mutex new_key_hcnt_mutex; bool _terminate = false; int returnNoError(HANDLE hContact); -int RecvMsgSvc_func(HANDLE hContact, std::wstring str, char *msg, DWORD flags) +int RecvMsgSvc_func(HANDLE hContact, std::wstring str, char *msg, DWORD flags, DWORD timestamp) { DWORD dbflags = DBEF_UTF; { //check for gpg related data @@ -38,7 +38,7 @@ int RecvMsgSvc_func(HANDLE hContact, std::wstring str, char *msg, DWORD flags) bool isContactHaveKey(HANDLE hContact); if(!isContactSecured(hContact)) { - debuglog<hContact)); setClistIcon(metaGetContact(ccs->hContact)); - HistoryLog(metaGetContact(ccs->hContact), "PGP Encryption turned on by key autoexchange feature", EVENTTYPE_MESSAGE, 0); + HistoryLog(metaGetContact(ccs->hContact), "PGP Encryption turned on by key autoexchange feature"); } - HistoryLog(ccs->hContact, "PGP Encryption turned on by key autoexchange feature", EVENTTYPE_MESSAGE, 0); + HistoryLog(ccs->hContact, "PGP Encryption turned on by key autoexchange feature"); } } return 1; @@ -481,7 +482,7 @@ int RecvMsgSvc(WPARAM w, LPARAM l) { //this is public key if(metaIsProtoMetaContacts(ccs->hContact)) { - HistoryLog(ccs->hContact, msg, EVENTTYPE_MESSAGE, dbflags); + HistoryLog(ccs->hContact, db_event(msg, 0, 0, dbflags)); return 0; } debuglog<hContact, GCDNF_TCHAR)<<"\n"; @@ -507,7 +508,7 @@ int RecvMsgSvc(WPARAM w, LPARAM l) new_key_hcnt_mutex.lock(); new_key_hcnt = ccs->hContact; ShowNewKeyDialog(); - HistoryLog(ccs->hContact, msg, EVENTTYPE_MESSAGE, dbflags); + HistoryLog(ccs->hContact, db_event(msg, 0, 0, dbflags)); return 0; } if(bAutoExchange && strstr(msg, "-----PGP KEY REQUEST-----") && isGPGConfigured()) @@ -568,7 +569,7 @@ int RecvMsgSvc(WPARAM w, LPARAM l) } if(!(strstr(msg, "-----BEGIN PGP MESSAGE-----") && strstr(msg, "-----END PGP MESSAGE-----"))) return CallService(MS_PROTO_CHAINRECV, w, l); - boost::thread *thr = new boost::thread(boost::bind(RecvMsgSvc_func, ccs->hContact, str, msg, ccs->wParam)); + boost::thread *thr = new boost::thread(boost::bind(RecvMsgSvc_func, ccs->hContact, str, msg, ccs->wParam, pre->timestamp)); return returnNoError(ccs->hContact); } @@ -602,7 +603,7 @@ int SendMsgSvc_func(HANDLE hContact, char *msg, DWORD flags) if(!tmp[0]) { mir_free(tmp); - HistoryLog(hContact, "Failed to encrypt message with GPG", EVENTTYPE_MESSAGE, DBEF_SENT); + HistoryLog(hContact, db_event("Failed to encrypt message with GPG", 0,0, DBEF_SENT)); hcontact_data[hContact].msgs_to_pass.push_back("Failed to encrypt message with GPG"); mir_free(msg); return CallContactService(hContact, PSS_MESSAGE, (WPARAM)flags, (LPARAM)msg); @@ -721,7 +722,7 @@ int SendMsgSvc_func(HANDLE hContact, char *msg, DWORD flags) } if(str.empty()) { - HistoryLog(hContact, "Failed to encrypt message with GPG", EVENTTYPE_MESSAGE, DBEF_SENT); + HistoryLog(hContact, db_event("Failed to encrypt message with GPG", 0,0, DBEF_SENT)); hcontact_data[hContact].msgs_to_pass.push_back("Failed to encrypt message with GPG"); debuglog<