summaryrefslogtreecommitdiff
path: root/protocols/MSN
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-28 17:38:49 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-28 17:38:49 +0000
commit5e9e63c45e37917ffb0acd83832d0d8f99d01883 (patch)
tree1b674b85b1f582a13bd2a57ec73377b8989141bc /protocols/MSN
parent7105dcf75bdd939ca52ba045bc29c536c3f7ba49 (diff)
new macroses for MS_PROTO_CHAINRECV: ProtoChainRecv, ProtoChainRecvMsg & ProtoChainRecvFile
git-svn-id: http://svn.miranda-ng.org/main/trunk@2540 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN')
-rw-r--r--protocols/MSN/src/msn_commands.cpp44
-rw-r--r--protocols/MSN/src/msn_mail.cpp7
-rw-r--r--protocols/MSN/src/msn_misc.cpp8
-rw-r--r--protocols/MSN/src/msn_p2p.cpp8
4 files changed, 15 insertions, 52 deletions
diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp
index 5a239dd986..743094b0dc 100644
--- a/protocols/MSN/src/msn_commands.cpp
+++ b/protocols/MSN/src/msn_commands.cpp
@@ -155,13 +155,7 @@ void CMsnProto::sttInviteMessage(ThreadData* info, char* msgBody, char* email, c
pre.tszDescription = tComment;
pre.ptszFiles = &ft->std.tszCurrentFile;
pre.lParam = (LPARAM)ft;
-
- CCSDATA ccs;
- ccs.hContact = ft->std.hContact;
- ccs.szProtoService = PSR_FILE;
- ccs.wParam = 0;
- ccs.lParam = (LPARAM)&pre;
- CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ ProtoChainRecvFile(ft->std.hContact, &pre);
return;
}
@@ -440,9 +434,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
if (!_strnicmp(tContentType, "text/plain", 10))
{
- CCSDATA ccs = {0};
-
- ccs.hContact = MSN_HContactFromEmail(email, nick, true, true);
+ HANDLE hContact = MSN_HContactFromEmail(email, nick, true, true);
const char* p = tHeader["X-MMS-IM-Format"];
bool isRtl = p != NULL && strstr(p, "RL=1") != NULL;
@@ -457,7 +449,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
{
if (_stricmp(info->mJoinedContactsWLID[j], email) == 0 && j != 0)
{
- ccs.hContact = info->getContactHandle();
+ hContact = info->getContactHandle();
break;
}
}
@@ -469,8 +461,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
parseWLID(NEWSTR_ALLOCA(email), NULL, &szEmail, NULL);
sentMsg = _stricmp(szEmail, MyOptions.szEmail) == 0;
if (sentMsg)
- ccs.hContact = ubmMsg ? MSN_HContactFromEmail(datau.toEmail, nick) :
- info->getContactHandle();
+ hContact = ubmMsg ? MSN_HContactFromEmail(datau.toEmail, nick) : info->getContactHandle();
}
const char* tP4Context = tHeader["P4-Context"];
@@ -493,7 +484,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
gce.dwFlags = GC_TCHAR | GCEF_ADDTOLOG;
gce.pDest = &gcd;
gce.ptszUID = mir_a2t(email);
- gce.ptszNick = GetContactNameT(ccs.hContact);
+ gce.ptszNick = GetContactNameT(hContact);
gce.time = time(NULL);
gce.bIsMe = FALSE;
@@ -505,29 +496,24 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
mir_free((void*)gce.pszText);
mir_free((void*)gce.ptszUID);
}
- else if (ccs.hContact)
+ else if (hContact)
{
if (!sentMsg)
{
- CallService(MS_PROTO_CONTACTISTYPING, WPARAM(ccs.hContact), 0);
+ CallService(MS_PROTO_CONTACTISTYPING, WPARAM(hContact), 0);
PROTORECVEVENT pre;
pre.szMessage = (char*)msgBody;
pre.flags = PREF_UTF + (isRtl ? PREF_RTL : 0);
pre.timestamp = (DWORD)time(NULL);
pre.lParam = 0;
-
- ccs.szProtoService = PSR_MESSAGE;
- ccs.wParam = 0;
- ccs.lParam = (LPARAM)&pre;
- CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ ProtoChainRecvMsg(hContact, &pre);
}
else
{
- DBEVENTINFO dbei = {0};
-
- bool haveWnd = MSN_MsgWndExist(ccs.hContact);
+ bool haveWnd = MSN_MsgWndExist(hContact);
+ DBEVENTINFO dbei = {0};
dbei.cbSize = sizeof(dbei);
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.flags = DBEF_SENT | DBEF_UTF | (haveWnd ? 0 : DBEF_READ) | (isRtl ? DBEF_RTL : 0);
@@ -535,7 +521,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
dbei.timestamp = time(NULL);
dbei.cbBlob = (unsigned)strlen(msgBody) + 1;
dbei.pBlob = (PBYTE)msgBody;
- CallService(MS_DB_EVENT_ADD, (WPARAM)ccs.hContact, (LPARAM)&dbei);
+ CallService(MS_DB_EVENT_ADD, (WPARAM)hContact, (LPARAM)&dbei);
}
}
}
@@ -979,13 +965,7 @@ void CMsnProto::sttProcessPage(char* buf, unsigned len)
pre.szMessage = (char*)szMsg;
pre.flags = PREF_UTF /*+ ((isRtl) ? PREF_RTL : 0)*/;
pre.timestamp = time(NULL);
-
- CCSDATA ccs = {0};
- ccs.hContact = MSN_HContactFromEmail(szTel, szTel, true, true);
- ccs.szProtoService = PSR_MESSAGE;
- ccs.lParam = (LPARAM)&pre;
- CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
-
+ ProtoChainRecvMsg( MSN_HContactFromEmail(szTel, szTel, true, true), &pre);
}
ezxml_free(xmlnot);
}
diff --git a/protocols/MSN/src/msn_mail.cpp b/protocols/MSN/src/msn_mail.cpp
index 869642d1d4..c5e0b593d1 100644
--- a/protocols/MSN/src/msn_mail.cpp
+++ b/protocols/MSN/src/msn_mail.cpp
@@ -121,12 +121,7 @@ void CMsnProto::getOIMs(ezxml_t xmli)
pre.szMessage = mailInfo.decodeMailBody((char*)mailbody);
pre.flags = PREF_UTF /*+ ((isRtl) ? PREF_RTL : 0)*/;
pre.timestamp = evtm;
-
- CCSDATA ccs = {0};
- ccs.hContact = MSN_HContactFromEmail(szEmail);
- ccs.szProtoService = PSR_MESSAGE;
- ccs.lParam = (LPARAM)&pre;
- CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ ProtoChainRecvMsg( MSN_HContactFromEmail(szEmail), &pre);
mir_free(pre.szMessage);
ezxml_t delmid = ezxml_add_child(delmids, "messageId", 0);
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp
index 5599ce3b22..0695989eb9 100644
--- a/protocols/MSN/src/msn_misc.cpp
+++ b/protocols/MSN/src/msn_misc.cpp
@@ -96,17 +96,11 @@ void CMsnProto::MSN_AddAuthRequest(const char *email, const char *nick, const c
if (reason == NULL) reason = "";
int reasonlen = (int)strlen(reason);
- CCSDATA ccs = { 0 };
PROTORECVEVENT pre = { 0 };
-
pre.flags = PREF_UTF;
pre.timestamp = (DWORD)time(NULL);
pre.lParam = sizeof(DWORD) + sizeof(HANDLE) + nicklen + emaillen + 5 + reasonlen;
- ccs.szProtoService = PSR_AUTH;
- ccs.hContact = hContact;
- ccs.lParam = (LPARAM)&pre;
-
char* pCurBlob = (char*)alloca(pre.lParam);
pre.szMessage = pCurBlob;
@@ -118,7 +112,7 @@ void CMsnProto::MSN_AddAuthRequest(const char *email, const char *nick, const c
strcpy(pCurBlob, email); pCurBlob += emaillen + 1; // E-mail
strcpy(pCurBlob, reason); // Reason
- CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ ProtoChainRecv(hContact, PSR_AUTH, 0, (LPARAM)&pre);
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/MSN/src/msn_p2p.cpp b/protocols/MSN/src/msn_p2p.cpp
index 599dee57fd..3a7a6c4429 100644
--- a/protocols/MSN/src/msn_p2p.cpp
+++ b/protocols/MSN/src/msn_p2p.cpp
@@ -1329,13 +1329,7 @@ void CMsnProto::p2p_InitFileTransfer(
pre.tszDescription = tComment;
pre.ptszFiles = &ft->std.tszCurrentFile;
pre.lParam = (LPARAM)ft;
-
- CCSDATA ccs;
- ccs.hContact = ft->std.hContact;
- ccs.szProtoService = PSR_FILE;
- ccs.wParam = 0;
- ccs.lParam = (LPARAM)&pre;
- CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ ProtoChainRecvFile(ft->std.hContact, &pre);
}
break;