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 --- utilities.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'utilities.cpp') diff --git a/utilities.cpp b/utilities.cpp index d368c56..83407d0 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -975,8 +975,6 @@ void AddHandlers() bool isContactSecured(HANDLE hContact) { - if(metaIsProtoMetaContacts(hContact)) - hContact = metaGetContact(hContact); BYTE gpg_enc = DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); if(!gpg_enc) return false; -- cgit v1.2.3 From 21f2c63d296d4cdf534de24a216811b4c4b744fc Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Fri, 1 Apr 2011 06:00:00 +0300 Subject: modified: utilities.cpp --- utilities.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'utilities.cpp') diff --git a/utilities.cpp b/utilities.cpp index 83407d0..8d33d4b 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -977,9 +977,12 @@ bool isContactSecured(HANDLE hContact) { BYTE gpg_enc = DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); if(!gpg_enc) + { + debuglog< 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 --- utilities.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'utilities.cpp') diff --git a/utilities.cpp b/utilities.cpp index 8d33d4b..c8dc2ae 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -380,6 +380,7 @@ int onProtoAck(WPARAM w, LPARAM l) { delete gpg_thread; TerminateProcess(params.hProcess, 1); + params.hProcess = NULL; debuglog< Date: Tue, 5 Apr 2011 07:44:13 +0300 Subject: modified: messages.cpp modified: utilities.cpp modified: utilities.h --- utilities.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'utilities.cpp') diff --git a/utilities.cpp b/utilities.cpp index c8dc2ae..91ea9fb 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -201,7 +201,7 @@ int SendKey(WPARAM w, LPARAM l) BYTE enc = DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); CallContactService(hContact, PSS_MESSAGE, (WPARAM)PREF_UTF, (LPARAM)szMessage); - HistoryLog(hContact, "Public key sent", EVENTTYPE_MESSAGE, DBEF_SENT); + HistoryLog(hContact, db_event("Public key sent", 0, 0, DBEF_SENT)); DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", enc); } mir_free(szMessage); @@ -586,16 +586,19 @@ void storeOutput(HANDLE ahandle, string *output) } while (available>0); } -void HistoryLog(HANDLE hContact, char *data, int event_type, int flags) +void HistoryLog(HANDLE hContact, db_event evt) { DBEVENTINFO Event = {0}; Event.cbSize = sizeof(Event); Event.szModule = szGPGModuleName; - Event.eventType = event_type; - Event.flags = flags; - Event.timestamp = (DWORD)time(NULL); - Event.cbBlob = strlen(data)+1; - Event.pBlob = (PBYTE)_strdup(data); + Event.eventType = evt.eventType; + Event.flags = evt.flags; + if(!evt.timestamp) + Event.timestamp = (DWORD)time(NULL); + else + Event.timestamp = evt.timestamp; + Event.cbBlob = strlen((char*)evt.pBlob)+1; + Event.pBlob = (PBYTE)_strdup((char*)evt.pBlob); CallService(MS_DB_EVENT_ADD, (WPARAM)(HANDLE)hContact,(LPARAM)&Event); } @@ -1154,7 +1157,8 @@ void send_encrypted_msgs_thread(HANDLE hContact) for(list::iterator p = hcontact_data[hContact].msgs_to_send.begin(); p != end; ++p) { CallContactService(hContact, PSS_MESSAGE, (WPARAM)PREF_UTF, (LPARAM)p->c_str()); - HistoryLog(hContact, (char*)p->c_str(), EVENTTYPE_MESSAGE, DBEF_SENT); + + HistoryLog(hContact, db_event((char*)p->c_str(),0,0, DBEF_SENT)); boost::this_thread::sleep(boost::posix_time::seconds(1)); } return; -- cgit v1.2.3 From 3d4fe3639635d0496906fb56b8014b14b0fd1ec7 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Wed, 13 Apr 2011 16:42:37 +0300 Subject: another metacontacts problem fixed --- utilities.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'utilities.cpp') diff --git a/utilities.cpp b/utilities.cpp index 91ea9fb..dbf8786 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -218,25 +218,23 @@ int ToggleEncryption(WPARAM w, LPARAM l) enc = DBGetContactSettingByte(metaGetMostOnline(hContact), szGPGModuleName, "GPGEncryption", 0); else enc = DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); + if(metaIsProtoMetaContacts(hContact)) { - if(metaIsProtoMetaContacts(hContact)) + HANDLE hcnt = NULL; + if(MessageBox(0, _T("Do you want to toggle encryption for all subcontacts ?"), _T("Metacontact detected"), MB_YESNO) == IDYES) { - HANDLE hcnt = NULL; - if(MessageBox(0, _T("Do you want to toggle encryption for all subcontacts ?"), _T("Metacontact detected"), MB_YESNO) == IDYES) + int count = metaGetContactsNum(hContact); + for(int i = 0; i < count; i++) { - int count = metaGetContactsNum(hContact); - for(int i = 0; i < count; i++) - { - hcnt = metaGetSubcontact(hContact, i); - if(hcnt) - DBWriteContactSettingByte(hcnt, szGPGModuleName, "GPGEncryption", enc?0:1); - } - DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", enc?0:1); + hcnt = metaGetSubcontact(hContact, i); + if(hcnt) + DBWriteContactSettingByte(hcnt, szGPGModuleName, "GPGEncryption", enc?0:1); } + DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", enc?0:1); } - else - DBWriteContactSettingByte(metaGetMostOnline(hContact), szGPGModuleName, "GPGEncryption", enc?0:1); } + else + DBWriteContactSettingByte(metaGetMostOnline(hContact), szGPGModuleName, "GPGEncryption", enc?0:1); void setSrmmIcon(HANDLE hContact); void setClistIcon(HANDLE hContact); setSrmmIcon(hContact); @@ -984,7 +982,7 @@ bool isContactSecured(HANDLE hContact) BYTE gpg_enc = DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); if(!gpg_enc) { - debuglog<