diff options
author | George Hazan <ghazan@miranda.im> | 2017-01-16 18:20:37 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-01-16 18:20:37 +0300 |
commit | 6163df27ad6fd2a5da5d9bbb48bb457d8a07a2b6 (patch) | |
tree | d0523b56e1b987789c6622916a31e8f356076d23 /protocols/FacebookRM | |
parent | e021b02022a37bd23b599801026d631f5fd9f48c (diff) |
DB_AUTH_BLOB: handy piece of code moved into the core
Diffstat (limited to 'protocols/FacebookRM')
-rw-r--r-- | protocols/FacebookRM/src/process.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp index 91124a04ab..e9aded49e9 100644 --- a/protocols/FacebookRM/src/process.cpp +++ b/protocols/FacebookRM/src/process.cpp @@ -1099,31 +1099,21 @@ void FacebookProto::ProcessFriendRequests(void*) isNew = true; setString(hContact, "RequestTime", time.c_str()); - //blob is: uin(DWORD), hContact(HANDLE), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ), reason(ASCIIZ) - //blob is: 0(DWORD), hContact(HANDLE), nick(ASCIIZ), ""(ASCIIZ), ""(ASCIIZ), email(ASCIIZ), reason(ASCIIZ) + DB_AUTH_BLOB blob(hContact, fbu.real_name.c_str(), 0, 0, fbu.user_id.c_str(), reason.c_str()); + DBEVENTINFO dbei = { 0 }; dbei.cbSize = sizeof(DBEVENTINFO); dbei.szModule = m_szModuleName; dbei.timestamp = ::time(NULL); dbei.flags = DBEF_UTF; dbei.eventType = EVENTTYPE_AUTHREQUEST; - dbei.cbBlob = (DWORD)(sizeof(DWORD) * 2 + fbu.real_name.length() + fbu.user_id.length() + reason.length() + 5); - - PBYTE pCurBlob = dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob); - *(PDWORD)pCurBlob = 0; pCurBlob += sizeof(DWORD); // UID - *(PDWORD)pCurBlob = (DWORD)hContact; pCurBlob += sizeof(DWORD); // Contact Handle - mir_strcpy((char*)pCurBlob, fbu.real_name.data()); pCurBlob += fbu.real_name.length() + 1; // Nickname - *pCurBlob = '\0'; pCurBlob++; // First Name - *pCurBlob = '\0'; pCurBlob++; // Last Name - mir_strcpy((char*)pCurBlob, fbu.user_id.data()); pCurBlob += fbu.user_id.length() + 1; // E-mail (we use it for string ID) - mir_strcpy((char*)pCurBlob, reason.data()); pCurBlob += reason.length() + 1; // Reason (we use it for info about common friends) - + dbei.cbBlob = blob.size(); + dbei.pBlob = blob; db_event_add(0, &dbei); } debugLogA(" < (%s) Friendship request [%s]", (isNew ? "New" : "Old"), time.c_str()); - } else { - debugLogA("!!! Wrong friendship request:\n%s", req.c_str()); } + else debugLogA("!!! Wrong friendship request:\n%s", req.c_str()); } facy.handle_success("friendRequests"); |