summaryrefslogtreecommitdiff
path: root/plugins/Dropbox/src/dropbox_events.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2014-03-12 11:29:59 +0000
committerAlexander Lantsev <aunsane@gmail.com>2014-03-12 11:29:59 +0000
commitd8d1baa7d5c286c907d18d278738331debc0aabd (patch)
treec6733298324026d6bd4ec0278bd3888a8f8b8be5 /plugins/Dropbox/src/dropbox_events.cpp
parentfcdaeaff6d96bf8a93c4f3c3426eff3146146d58 (diff)
Dropbox:
- fixed message with download link - fixed minor bug in file uploading git-svn-id: http://svn.miranda-ng.org/main/trunk@8570 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dropbox/src/dropbox_events.cpp')
-rw-r--r--plugins/Dropbox/src/dropbox_events.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/plugins/Dropbox/src/dropbox_events.cpp b/plugins/Dropbox/src/dropbox_events.cpp
index 69397d8608..a10917c236 100644
--- a/plugins/Dropbox/src/dropbox_events.cpp
+++ b/plugins/Dropbox/src/dropbox_events.cpp
@@ -186,26 +186,31 @@ int CDropbox::OnSendSuccessed(void *obj, WPARAM hContact, LPARAM lParam)
if (db_get_b(NULL, MODULE, "UrlAutoSend", 1))
{
- DBEVENTINFO dbei = { sizeof(dbei) };
- dbei.flags = DBEF_UTF;
- dbei.szModule = MODULE;
- dbei.timestamp = time(NULL);
- dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.cbBlob = wcslen(data);
- dbei.pBlob = (PBYTE)mir_utf8encodeW(data);
-
+ char *message = mir_utf8encodeW(data);
if (hContact != instance->GetDefaultContact())
{
- if (CallContactService(hContact, PSS_MESSAGE, 0, (LPARAM)data) != ACKRESULT_FAILED)
+ if (CallContactService(hContact, PSS_MESSAGE, PREF_UTF, (LPARAM)message) != ACKRESULT_FAILED)
{
- dbei.flags = DBEF_SENT | DBEF_READ | DBEF_UTF;
- db_event_add(hContact, &dbei);
+ PROTORECVEVENT recv = { 0 };
+ recv.flags = PREF_CREATEREAD | DBEF_UTF;
+ recv.timestamp = time(NULL);
+ recv.szMessage = message;
+ ProtoChainRecvMsg(hContact, &recv);
}
else
CallServiceSync(MS_MSG_SENDMESSAGEW, (WPARAM)hContact, (LPARAM)data);
}
else
+ {
+ DBEVENTINFO dbei = { sizeof(dbei) };
+ dbei.flags = DBEF_UTF;
+ dbei.szModule = MODULE;
+ dbei.timestamp = time(NULL);
+ dbei.eventType = EVENTTYPE_MESSAGE;
+ dbei.cbBlob = wcslen(data);
+ dbei.pBlob = (PBYTE)message;
db_event_add(hContact, &dbei);
+ }
}
CMString urls = data; urls += L"\r\n";