From 34571247cb430bcc9be56630e9fb0a714b5fd4c8 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Fri, 1 Apr 2011 05:50:42 +0300 Subject: modified: icons.cpp modified: messages.cpp modified: utilities.cpp --- messages.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'messages.cpp') diff --git a/messages.cpp b/messages.cpp index f7ea63f..f421e4a 100644 --- a/messages.cpp +++ b/messages.cpp @@ -729,9 +729,12 @@ int SendMsgSvc_func(HANDLE hContact, char *msg, DWORD flags) if(metaIsSubcontact(hContact)) { hcontact_data[metaGetContact(hContact)].msgs_to_pass.push_back(str_event); + debuglog<<(TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR)<<"is subcontact of"<<(TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)metaGetContact(hContact), GCDNF_TCHAR)<<"\n"; + debuglog<pBlob)) { hcontact_data[hContact].msgs_to_pass.erase(i); + debuglog<pBlob<<"\" passed event filter, contact "<<(TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR)<<", message is in allowed list\n"; event_processing_mutex.unlock(); return 0; } @@ -860,7 +864,10 @@ int HookSendMsg(WPARAM w, LPARAM l) return 1; } if(!isContactSecured(hContact)) + { + debuglog<pBlob<<"\" passed event filter, contact "<<(TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR)<<" is unsecured\n"; return 0; + } if(!(dbei->flags & DBEF_SENT) && metaIsProtoMetaContacts((HANDLE)w)) { char tmp[29]; @@ -869,7 +876,7 @@ int HookSendMsg(WPARAM w, LPARAM l) if(strstr(tmp, "-----BEGIN PGP MESSAGE-----")) return 1; } - return 0; + return 1; } -- cgit v1.2.3 From 77664979ae7f2e534e31f66aa9286d874d9da2bc Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Fri, 1 Apr 2011 10:14:07 +0300 Subject: modified: gpg_wrapper.cpp modified: gpg_wrapper.h modified: main.cpp modified: messages.cpp modified: options.cpp modified: utilities.cpp --- messages.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'messages.cpp') diff --git a/messages.cpp b/messages.cpp index f421e4a..88a9097 100644 --- a/messages.cpp +++ b/messages.cpp @@ -36,7 +36,7 @@ int RecvMsgSvc_func(HANDLE hContact, std::wstring str, char *msg, DWORD flags) void setSrmmIcon(HANDLE); void setClistIcon(HANDLE); bool isContactHaveKey(HANDLE hContact); - if(!DBGetContactSettingByte(metaGetMostOnline(hContact), szGPGModuleName, "GPGEncryption", 0)) + if(!isContactSecured(hContact)) { debuglog< Date: Fri, 1 Apr 2011 10:28:13 +0300 Subject: idiot... --- messages.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'messages.cpp') diff --git a/messages.cpp b/messages.cpp index 88a9097..2a52bb7 100644 --- a/messages.cpp +++ b/messages.cpp @@ -883,7 +883,7 @@ int HookSendMsg(WPARAM w, LPARAM l) if(strstr(tmp, "-----BEGIN PGP MESSAGE-----")) return 1; } - return 1; + return 0; } -- cgit v1.2.3 From 62bf3df560d4e2a271c587b8bea4ce38a9ac1b2f Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Sat, 2 Apr 2011 04:46:14 +0300 Subject: modified: messages.cpp modified: new_gpg.vcxproj --- messages.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'messages.cpp') diff --git a/messages.cpp b/messages.cpp index 2a52bb7..51bd113 100644 --- a/messages.cpp +++ b/messages.cpp @@ -479,7 +479,7 @@ int RecvMsgSvc(WPARAM w, LPARAM l) } if((s2 != wstring::npos) && (s1 != wstring::npos)) { //this is public key - if(metaIsSubcontact(ccs->hContact)) + if(metaIsProtoMetaContacts(ccs->hContact)) { HistoryLog(ccs->hContact, msg, EVENTTYPE_MESSAGE, dbflags); return 0; -- cgit v1.2.3 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< Date: Sat, 9 Apr 2011 23:31:11 +0300 Subject: modified: messages.cpp --- messages.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'messages.cpp') diff --git a/messages.cpp b/messages.cpp index f73223e..4b4a686 100644 --- a/messages.cpp +++ b/messages.cpp @@ -310,7 +310,7 @@ int RecvMsgSvc_func(HANDLE hContact, std::wstring str, char *msg, DWORD flags, D return 0; } char *tmp = mir_strdup(toUTF8(str).c_str()); - HistoryLog(hContact, db_event(msg, timestamp, 0, dbflags)); + HistoryLog(hContact, db_event(tmp, timestamp, 0, dbflags)); mir_free(tmp); return 0; } -- cgit v1.2.3