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/MSN/src/msn_misc.cpp | |
parent | e021b02022a37bd23b599801026d631f5fd9f48c (diff) |
DB_AUTH_BLOB: handy piece of code moved into the core
Diffstat (limited to 'protocols/MSN/src/msn_misc.cpp')
-rw-r--r-- | protocols/MSN/src/msn_misc.cpp | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index cc620c1dc1..d4e873b20f 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -81,33 +81,14 @@ char** CMsnProto::GetStatusMsgLoc(int status) // MSN_AddAuthRequest - adds the authorization event to the database
void CMsnProto::MSN_AddAuthRequest(const char *email, const char *nick, const char *reason)
{
- //blob is: UIN=0(DWORD), hContact(DWORD), nick(ASCIIZ), ""(ASCIIZ), ""(ASCIIZ), email(ASCIIZ), ""(ASCIIZ)
-
MCONTACT hContact = MSN_HContactFromEmail(email, nick, true, true);
- int emaillen = (int)mir_strlen(email);
-
- if (nick == NULL) nick = "";
- int nicklen = (int)mir_strlen(nick);
-
- if (reason == NULL) reason = "";
- int reasonlen = (int)mir_strlen(reason);
+ DB_AUTH_BLOB blob(hContact, nick, 0, 0, email, reason);
PROTORECVEVENT pre = { 0 };
pre.timestamp = (DWORD)time(NULL);
- pre.lParam = sizeof(DWORD) + sizeof(HANDLE) + nicklen + emaillen + 5 + reasonlen;
-
- char* pCurBlob = (char*)alloca(pre.lParam);
- pre.szMessage = pCurBlob;
-
- *(PDWORD)pCurBlob = 0; pCurBlob += sizeof(DWORD); // UID
- *(PDWORD)pCurBlob = (DWORD)hContact; pCurBlob += sizeof(DWORD); // Contact Handle
- mir_strcpy(pCurBlob, nick); pCurBlob += nicklen + 1; // Nickname
- *pCurBlob = '\0'; pCurBlob++; // First Name
- *pCurBlob = '\0'; pCurBlob++; // Last Name
- mir_strcpy(pCurBlob, email); pCurBlob += emaillen + 1; // E-mail
- mir_strcpy(pCurBlob, reason); // Reason
-
+ pre.lParam = blob.size();
+ pre.szMessage = blob;
ProtoChainRecv(hContact, PSR_AUTH, 0, (LPARAM)&pre);
}
|