summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--messages.cpp4
-rw-r--r--utilities.cpp12
-rw-r--r--utilities.h1
3 files changed, 3 insertions, 14 deletions
diff --git a/messages.cpp b/messages.cpp
index a0389a7..dbb87c2 100644
--- a/messages.cpp
+++ b/messages.cpp
@@ -245,7 +245,7 @@ int RecvMsgSvc(WPARAM w, LPARAM l)
}
mir_free(caps);
if(str.find(_T("GPG_Key_Auto_Exchange:0")) != string::npos)
- CallContactService(hContact, PSS_MESSAGE, (WPARAM)PREF_UTF, (LPARAM)"-----PGP KEY REQUEST-----");
+ CallContactService(hContact, PSS_MESSAGE, (WPARAM)0, (LPARAM)"-----PGP KEY REQUEST-----");
}
}
}
@@ -488,7 +488,7 @@ int RecvMsgSvc(WPARAM w, LPARAM l)
{
string str = pre->szMessage;
mir_free((void**)pre->szMessage);
- str.insert(0, "Failed to decrypt GPG encrypted message.\nReceived unencrypted message:\n");
+ str.insert(0, "Failed to decrypt GPG encrypted message.\nMessage body for manual decryption:\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);
diff --git a/utilities.cpp b/utilities.cpp
index 82a30bf..0ba8e12 100644
--- a/utilities.cpp
+++ b/utilities.cpp
@@ -975,20 +975,10 @@ int returnNoError(HANDLE hContact) {
string toUTF8(wstring str)
{
string ustr;
- wstring tmpstr;
- utf8::replace_invalid(str.begin(), str.end(), back_inserter(tmpstr));
- utf8::utf16to8(tmpstr.begin(), tmpstr.end(), back_inserter(ustr));
+ utf8::utf16to8(str.begin(), str.end(), back_inserter(ustr));
return ustr;
}
-string toUTF8(string str)
-{
- string ustr;
- wstring tmpstr;
- utf8::replace_invalid(str.begin(), str.end(), back_inserter(tmpstr));
- utf8::utf16to8(tmpstr.begin(), tmpstr.end(), back_inserter(ustr));
- return ustr;
-}
wstring toUTF16(string str) //convert as much as possible
diff --git a/utilities.h b/utilities.h
index 58a23b9..bb4b459 100644
--- a/utilities.h
+++ b/utilities.h
@@ -32,7 +32,6 @@ bool isContactHaveKey(HANDLE hContact);
bool isGPGConfigured();
const bool StriStr(const char *str, const char *substr);
string toUTF8(wstring str);
-string toUTF8(string str);
wstring toUTF16(string str);
string get_random(int length);
string time_str();