summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_contacts.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-08-08 08:43:36 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-08-08 08:43:36 +0000
commit2bf60b8c681e1a72fddfc1490b154b8ffd4389c9 (patch)
tree965b218456e6bff20be0899c365170ab0765c3ec /protocols/SkypeWeb/src/skype_contacts.cpp
parent4a0631399b72ff7a62ffc2da69150551e990e0d9 (diff)
SkypeWeb: cslock for append message; optimization
git-svn-id: http://svn.miranda-ng.org/main/trunk@14858 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_contacts.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_contacts.cpp19
1 files changed, 4 insertions, 15 deletions
diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp
index 56e0ef62d9..05df715501 100644
--- a/protocols/SkypeWeb/src/skype_contacts.cpp
+++ b/protocols/SkypeWeb/src/skype_contacts.cpp
@@ -140,23 +140,12 @@ void CSkypeProto::LoadContactsAuth(const NETLIBHTTPREQUEST *response)
db_set_dw(hContact, m_szModuleName, "LastAuthRequestTime", eventTime);
delSetting(hContact, "Auth");
+ DB_AUTH_BLOB blob(hContact, NULL, NULL, NULL, skypename.c_str(), reason.c_str());
+
PROTORECVEVENT pre = { 0 };
pre.timestamp = time(NULL);
- pre.lParam = (DWORD)(sizeof(DWORD) * 2 + skypename.size() + reason.size() + 5);
-
- /*blob is: 0(DWORD), hContact(DWORD), nick(ASCIIZ), firstName(ASCIIZ), lastName(ASCIIZ), id(ASCIIZ), reason(ASCIIZ)*/
- PBYTE pBlob, pCurBlob;
- pCurBlob = pBlob = (PBYTE)mir_calloc(pre.lParam);
-
- *((PDWORD)pCurBlob) = 0;
- pCurBlob += sizeof(DWORD);
- *((PDWORD)pCurBlob) = (DWORD)hContact;
- pCurBlob += sizeof(DWORD);
- pCurBlob += 3;
- mir_strcpy((char*)pCurBlob, skypename.c_str());
- pCurBlob += skypename.size() + 1;
- mir_strcpy((char*)pCurBlob, reason.c_str());
- pre.szMessage = (char*)pBlob;
+ pre.lParam = blob.size();
+ pre.szMessage = blob;
ProtoChainRecv(hContact, PSR_AUTH, 0, (LPARAM)&pre);
}