summaryrefslogtreecommitdiff
path: root/plugins/Dropbox/src/dropbox_services.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-05-21 16:11:58 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-05-21 16:11:58 +0000
commit48266e479d1fcf5153b29c612866845990fccad8 (patch)
treec8cbc908cd3c5f08731e5e8d7eaac6b568007d09 /plugins/Dropbox/src/dropbox_services.cpp
parentebdb556f152734035846f120eb8112f88ef91281 (diff)
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
Diffstat (limited to 'plugins/Dropbox/src/dropbox_services.cpp')
-rw-r--r--plugins/Dropbox/src/dropbox_services.cpp20
1 files changed, 6 insertions, 14 deletions
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;
}