diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-05-13 15:21:50 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-05-13 15:21:50 +0000 |
commit | ac60e6cd374568da60bf732a8018f94d48ee9dd7 (patch) | |
tree | e85ce8fe96226a39f3d1432f29c769cd5926047c /plugins/Dropbox/src/dropbox_services.cpp | |
parent | 71846c4e387e27164ffde6b2e8a188b3bc21b2eb (diff) |
Dropbox:
- fixed commands sending
- removed status changing
git-svn-id: http://svn.miranda-ng.org/main/trunk@13571 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dropbox/src/dropbox_services.cpp')
-rw-r--r-- | plugins/Dropbox/src/dropbox_services.cpp | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/plugins/Dropbox/src/dropbox_services.cpp b/plugins/Dropbox/src/dropbox_services.cpp index 059d92036b..d558fa7917 100644 --- a/plugins/Dropbox/src/dropbox_services.cpp +++ b/plugins/Dropbox/src/dropbox_services.cpp @@ -41,30 +41,10 @@ INT_PTR CDropbox::ProtoLoadIcon(WPARAM wParam, LPARAM) return (LOWORD(wParam) == PLI_PROTOCOL) ? (INT_PTR)CopyIcon(LoadIconEx(IDI_DROPBOX)) : 0;
}
-INT_PTR CDropbox::ProtoGetStatus(WPARAM, LPARAM)
-{
- return g_nStatus;
-}
-
-INT_PTR CDropbox::ProtoSetStatus(void *obj, WPARAM wp, LPARAM)
+INT_PTR CDropbox::ProtoGetStatus(void *obj, WPARAM, LPARAM)
{
CDropbox *instance = (CDropbox*)obj;
- int nStatus = wp;
- if ((ID_STATUS_ONLINE == nStatus) || (ID_STATUS_OFFLINE == nStatus))
- {
- int nOldStatus = g_nStatus;
- if (nStatus != g_nStatus)
- {
- g_nStatus = nStatus;
-
- MCONTACT hContact = instance->GetDefaultContact();
- db_set_w(hContact, MODULE, "Status", nStatus);
-
- ProtoBroadcastAck(MODULE, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)nOldStatus, g_nStatus);
- }
- }
-
- return 0;
+ return instance->HasAccessToken() ? ID_STATUS_ONLINE : ID_STATUS_OFFLINE;
}
INT_PTR CDropbox::ProtoSendFile(void *obj, WPARAM, LPARAM lParam)
@@ -172,7 +152,14 @@ INT_PTR CDropbox::ProtoSendMessage(void *obj, WPARAM, LPARAM lParam) CCSDATA *pccsd = (CCSDATA*)lParam;
- char *message = NEWSTR_ALLOCA((char*)pccsd->lParam);
+ 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;
|