summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ/src/fam_04message.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-01-16 18:20:37 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-01-16 18:20:37 +0300
commit6163df27ad6fd2a5da5d9bbb48bb457d8a07a2b6 (patch)
treed0523b56e1b987789c6622916a31e8f356076d23 /protocols/IcqOscarJ/src/fam_04message.cpp
parente021b02022a37bd23b599801026d631f5fd9f48c (diff)
DB_AUTH_BLOB: handy piece of code moved into the core
Diffstat (limited to 'protocols/IcqOscarJ/src/fam_04message.cpp')
-rw-r--r--protocols/IcqOscarJ/src/fam_04message.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/protocols/IcqOscarJ/src/fam_04message.cpp b/protocols/IcqOscarJ/src/fam_04message.cpp
index 1d2b182bd9..ff2438da29 100644
--- a/protocols/IcqOscarJ/src/fam_04message.cpp
+++ b/protocols/IcqOscarJ/src/fam_04message.cpp
@@ -1627,20 +1627,13 @@ void CIcqProto::handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp,
break;
}
{
+ DB_AUTH_BLOB blob(hContact, pszMsgField[0], pszMsgField[1], pszMsgField[2], pszMsgField[3], pszMsgField[5]);
+ *(PBYTE)blob = dwUin;
+
PROTORECVEVENT pre = { 0 };
pre.timestamp = dwTimestamp;
- pre.lParam = sizeof(DWORD) * 2 + mir_strlen(pszMsgField[0]) + mir_strlen(pszMsgField[1]) + mir_strlen(pszMsgField[2]) + mir_strlen(pszMsgField[3]) + mir_strlen(pszMsgField[5]) + 5;
-
- // blob is: uin(DWORD), hcontact(HANDLE), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ), reason(ASCIIZ)
- char *szBlob, *pCurBlob = szBlob = (char *)_alloca(pre.lParam);
- *(DWORD*)pCurBlob = dwUin; pCurBlob += sizeof(DWORD);
- *(DWORD*)pCurBlob = DWORD(hContact); pCurBlob += sizeof(DWORD);
- mir_strcpy((char*)pCurBlob, pszMsgField[0]); pCurBlob += mir_strlen((char*)pCurBlob) + 1;
- mir_strcpy((char*)pCurBlob, pszMsgField[1]); pCurBlob += mir_strlen((char*)pCurBlob) + 1;
- mir_strcpy((char*)pCurBlob, pszMsgField[2]); pCurBlob += mir_strlen((char*)pCurBlob) + 1;
- mir_strcpy((char*)pCurBlob, pszMsgField[3]); pCurBlob += mir_strlen((char*)pCurBlob) + 1;
- mir_strcpy((char*)pCurBlob, pszMsgField[5]);
- pre.szMessage = (char *)szBlob;
+ pre.lParam = blob.size();
+ pre.szMessage = blob;
ProtoChainRecv(hContact, PSR_AUTH, 0, (LPARAM)&pre);
}
break;