From 48266e479d1fcf5153b29c612866845990fccad8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 21 May 2015 16:11:58 +0000 Subject: war against atavisms continues - everything that goes to PSS_MESSAGE should be sent as utf8 string; - thus PREF_UNICODE & PREF_UTF support discontinued, these constants are removed; - support for PREF_UNICODE & PREF_UTF in protocols also removed; - PREF_UNICODE used in file transfers (PROTOFILERECVT) replaced with PRFF_UNICODE / PRFF_TCHAR git-svn-id: http://svn.miranda-ng.org/main/trunk@13734 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dropbox/src/dropbox_services.cpp | 20 ++++++-------------- plugins/Dropbox/src/dropbox_transfers.cpp | 2 +- 2 files changed, 7 insertions(+), 15 deletions(-) (limited to 'plugins/Dropbox/src') diff --git a/plugins/Dropbox/src/dropbox_services.cpp b/plugins/Dropbox/src/dropbox_services.cpp index c32ebf1802..66e5c14b98 100644 --- a/plugins/Dropbox/src/dropbox_services.cpp +++ b/plugins/Dropbox/src/dropbox_services.cpp @@ -149,28 +149,21 @@ INT_PTR CDropbox::ProtoSendMessage(WPARAM, LPARAM lParam) return 0; } - char *message = NULL; char *szMessage = (char*)pccsd->lParam; - if (pccsd->wParam & PREF_UNICODE) - message = mir_utf8encodeW((wchar_t*)&szMessage[mir_strlen(szMessage) + 1]); - else if (pccsd->wParam & PREF_UTF) - message = mir_strdup(szMessage); - else - message = mir_utf8encode(szMessage); DBEVENTINFO dbei = { sizeof(dbei) }; dbei.szModule = MODULE; dbei.timestamp = time(NULL); dbei.eventType = EVENTTYPE_MESSAGE; - dbei.cbBlob = (int)mir_strlen(message); - dbei.pBlob = (PBYTE)message; + dbei.cbBlob = (int)mir_strlen(szMessage); + dbei.pBlob = (PBYTE)szMessage; dbei.flags = DBEF_SENT | DBEF_READ | DBEF_UTF; db_event_add(pccsd->hContact, &dbei); - if (message[0] && message[0] == '/') + if (*szMessage == '/') { // parse commands - char *sep = strchr(message, ' '); + char *sep = strchr(szMessage, ' '); if (sep != NULL) *sep = 0; struct @@ -188,7 +181,7 @@ INT_PTR CDropbox::ProtoSendMessage(WPARAM, LPARAM lParam) for (int i = 0; i < SIZEOF(commands); i++) { - if (!strcmp(message + 1, commands[i].szCommand)) + if (!strcmp(szMessage+1, commands[i].szCommand)) { ULONG messageId = InterlockedIncrement(&hMessageProcess); @@ -206,9 +199,8 @@ INT_PTR CDropbox::ProtoSendMessage(WPARAM, LPARAM lParam) } char help[1024]; - mir_snprintf(help, SIZEOF(help), Translate("\"%s\" is not valid.\nUse \"/help\" for more info."), message); + mir_snprintf(help, SIZEOF(help), Translate("\"%s\" is not valid.\nUse \"/help\" for more info."), szMessage); CallContactService(GetDefaultContact(), PSR_MESSAGE, 0, (LPARAM)help); - return 0; } diff --git a/plugins/Dropbox/src/dropbox_transfers.cpp b/plugins/Dropbox/src/dropbox_transfers.cpp index cceb9ea985..40aa523691 100644 --- a/plugins/Dropbox/src/dropbox_transfers.cpp +++ b/plugins/Dropbox/src/dropbox_transfers.cpp @@ -228,7 +228,7 @@ UINT CDropbox::SendFilesAndReportAsync(void *owner, void *arg) char *message = mir_utf8encode(data); if (ftp->hContact != instance->GetDefaultContact()) { - if (CallContactService(ftp->hContact, PSS_MESSAGE, PREF_UTF, (LPARAM)message) != ACKRESULT_FAILED) + if (CallContactService(ftp->hContact, PSS_MESSAGE, 0, (LPARAM)message) != ACKRESULT_FAILED) { DBEVENTINFO dbei = { sizeof(dbei) }; dbei.flags = DBEF_UTF | DBEF_SENT/* | DBEF_READ*/; -- cgit v1.2.3