summaryrefslogtreecommitdiff
path: root/protocols/Gadu-Gadu
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Gadu-Gadu')
-rw-r--r--protocols/Gadu-Gadu/src/core.cpp10
-rw-r--r--protocols/Gadu-Gadu/src/filetransfer.cpp3
-rw-r--r--protocols/Gadu-Gadu/src/image.cpp12
3 files changed, 6 insertions, 19 deletions
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp
index 4c6b1faa59..acd2d89b74 100644
--- a/protocols/Gadu-Gadu/src/core.cpp
+++ b/protocols/Gadu-Gadu/src/core.cpp
@@ -845,15 +845,11 @@ retry:
// Check if not empty message ( who needs it? )
else if (!e->event.msg.recipients_count && e->event.msg.message && *e->event.msg.message && strcmp(e->event.msg.message, "\xA0\0"))
{
- CCSDATA ccs = {0};
PROTORECVEVENT pre = {0};
time_t t = time(NULL);
- ccs.szProtoService = PSR_MESSAGE;
- ccs.hContact = getcontact(e->event.msg.sender, 1, 0, NULL);
- ccs.lParam = (LPARAM)⪯
pre.timestamp = (!(e->event.msg.msgclass & GG_CLASS_OFFLINE) || e->event.msg.time > (t - timeDeviation)) ? t : e->event.msg.time;
pre.szMessage = e->event.msg.message;
- CallService(MS_PROTO_CHAINRECV, 0, (LPARAM) &ccs);
+ ProtoChainRecvMsg( getcontact(e->event.msg.sender, 1, 0, NULL), &pre);
}
// RichEdit format included (image)
@@ -1070,9 +1066,7 @@ retry:
pre.tszDescription = filenameT;
pre.ptszFiles = &filenameT;
pre.lParam = (LPARAM)dcc7;
-
- CCSDATA ccs = { dcc7->contact, PSR_FILE, 0, (LPARAM)&pre };
- CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ ProtoChainRecvFile(dcc7->contact, &pre);
mir_free(filenameT);
e->event.dcc7_new = NULL;
diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp
index 3503b0bc9a..a111bbb022 100644
--- a/protocols/Gadu-Gadu/src/filetransfer.cpp
+++ b/protocols/Gadu-Gadu/src/filetransfer.cpp
@@ -392,9 +392,8 @@ void __cdecl GGPROTO::dccmainthread(void*)
pre.ptszFiles = &filenameT;
pre.lParam = (LPARAM)local_dcc;
- CCSDATA ccs = { local_dcc->contact, PSR_FILE, 0, (LPARAM)&pre };
gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 7, "ft_mutex", 1);
- CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ ProtoChainRecvFile(local_dcc->contact, &pre);
gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1);
mir_free(filenameT);
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp
index 9a6b934054..22d1f7fe14 100644
--- a/protocols/Gadu-Gadu/src/image.cpp
+++ b/protocols/Gadu-Gadu/src/image.cpp
@@ -851,18 +851,12 @@ int GGPROTO::img_displayasmsg(HANDLE hContact, void *img)
if (res != 0) {
char image_msg[MAX_PATH + 11];
- CCSDATA ccs = {0};
- PROTORECVEVENT pre = {0};
+ mir_snprintf(image_msg, SIZEOF(image_msg), "[img]%s[/img]", (char*)_T2A(szPath));
- ccs.szProtoService = PSR_MESSAGE;
- ccs.hContact = hContact;
- ccs.lParam = (LPARAM)⪯
- char* szPathA = mir_t2a(szPath);
- mir_snprintf(image_msg, SIZEOF(image_msg), "[img]%s[/img]", szPathA);
- mir_free(szPathA);
+ PROTORECVEVENT pre = {0};
pre.timestamp = time(NULL);
pre.szMessage = image_msg;
- CallService(MS_PROTO_CHAINRECV, 0, (LPARAM) &ccs);
+ ProtoChainRecvMsg(hContact, &pre);
netlog("img_displayasmsg(): Image saved to %s.", szPath);
}
else