diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-11-01 20:23:28 +0200 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-11-01 20:23:28 +0200 |
commit | c2c8b96313665152d56efcb0f7bc6fa5888d6a59 (patch) | |
tree | 7d04a0730104df1a3c0f3b69e4bcd7b295ad0d60 | |
parent | e5439085cf086c64bd6e98a8c85fc02fa35fd9e2 (diff) |
fixes
-rw-r--r-- | messages.cpp | 18 | ||||
-rw-r--r-- | utilities.cpp | 5 |
2 files changed, 18 insertions, 5 deletions
diff --git a/messages.cpp b/messages.cpp index 92bdb78..6d502f4 100644 --- a/messages.cpp +++ b/messages.cpp @@ -142,6 +142,17 @@ int RecvMsgSvc(WPARAM w, LPARAM l) mir_free(tmp);
}
DBWriteContactSettingByte(hContact, szGPGModuleName, "bAlwatsTrust", 1); + void setSrmmIcon(HANDLE); + void setClistIcon(HANDLE); + setSrmmIcon(hContact); + setClistIcon(hContact); + if(metaIsSubcontact(hContact)) + { + setSrmmIcon(metaGetContact(hContact)); + setClistIcon(metaGetContact(hContact)); + HistoryLog(metaGetContact(hContact), "PGP Encryption turned on by key autoexchange feature", EVENTTYPE_MESSAGE, DBEF_READ); + } + HistoryLog(hContact, "PGP Encryption turned on by key autoexchange feature", EVENTTYPE_MESSAGE, 0); } } hcontact_data[hContact].msgs_to_ignore.push_back(msg); @@ -478,7 +489,7 @@ int RecvMsgSvc(WPARAM w, LPARAM l) { string str = pre->szMessage; mir_free((void**)pre->szMessage); - str.insert(0, "Received unencrypted message:\n"); + str.insert(0, "Failed to decrypt GPG encrypted message.\nReceived unencrypted message:\n"); debuglog<<time_str()<<": info: Failed to decrypt GPG encrypted message.\n"; pre->szMessage = mir_strdup(str.c_str()); return CallService(MS_PROTO_CHAINRECV, w, (LPARAM)ccs); @@ -515,9 +526,10 @@ int RecvMsgSvc(WPARAM w, LPARAM l) mir_free(msg); return 1; } - wstring str = toUTF16(msg); + string str = msg; mir_free((void**)pre->szMessage); - pre->szMessage = mir_strdup(toUTF8(str).c_str()); + str.insert(0, "Received unencrypted message:\n"); + pre->szMessage = mir_strdup(str.c_str()); return CallService(MS_PROTO_CHAINRECV, w, (LPARAM)ccs); } return CallService(MS_PROTO_CHAINRECV, w, l); diff --git a/utilities.cpp b/utilities.cpp index c1bb062..619cded 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -963,10 +963,11 @@ void send_encrypted_msgs_thread(HANDLE hContact) while(true)
{
char *key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", "");
- if(!key[0])
+ while(!isContactSecured(hContact))
boost::this_thread::sleep(boost::posix_time::seconds(1));
- else if(!hcontact_data[hContact].msgs_to_send.empty())
+ if(!hcontact_data[hContact].msgs_to_send.empty())
{
+ boost::this_thread::sleep(boost::posix_time::seconds(1));
list<string>::iterator end = hcontact_data[hContact].msgs_to_send.end();
for(list<string>::iterator p = hcontact_data[hContact].msgs_to_send.begin(); p != end; ++p)
{
|