summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/SkypeWeb/src/skype_utils.h')
-rw-r--r--protocols/SkypeWeb/src/skype_utils.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/protocols/SkypeWeb/src/skype_utils.h b/protocols/SkypeWeb/src/skype_utils.h
index f4f7c14035..b50b65546a 100644
--- a/protocols/SkypeWeb/src/skype_utils.h
+++ b/protocols/SkypeWeb/src/skype_utils.h
@@ -35,6 +35,7 @@ class DB_AUTH_BLOB
pCurBlob += sizeof(DWORD);
*((PDWORD)pCurBlob) = (DWORD)hContact;
pCurBlob += sizeof(DWORD);
+
if (szNick) { mir_strcpy((char*)pCurBlob, szNick ); pCurBlob += mir_strlen(szNick ); } pCurBlob += 1;
if (szFirstName){ mir_strcpy((char*)pCurBlob, szFirstName); pCurBlob += mir_strlen(szFirstName); } pCurBlob += 1;
if (szLastName) { mir_strcpy((char*)pCurBlob, szLastName ); pCurBlob += mir_strlen(szLastName ); } pCurBlob += 1;
@@ -49,10 +50,30 @@ public:
DB_AUTH_BLOB(MCONTACT _hContact, LPCSTR nick, LPCSTR fname, LPCSTR lname, LPCSTR id, LPCSTR reason)
: hContact(_hContact), szNick(mir_strdup(nick)), szFirstName(mir_strdup(fname)), szLastName(mir_strdup(lname)), szId(mir_strdup(id)), szReason(mir_strdup(reason)) {}
+ __inline explicit DB_AUTH_BLOB(PBYTE blob)
+ {
+ PBYTE pCurBlob = blob;
+ pCurBlob += sizeof(DWORD);
+ hContact = *(PDWORD)pCurBlob;
+ pCurBlob += sizeof(DWORD);
+ szNick = mir_strdup((char*)pCurBlob); pCurBlob += mir_strlen((char*)pCurBlob) + 1;
+ szFirstName = mir_strdup((char*)pCurBlob); pCurBlob += mir_strlen((char*)pCurBlob) + 1;
+ szLastName = mir_strdup((char*)pCurBlob); pCurBlob += mir_strlen((char*)pCurBlob) + 1;
+ szId = mir_strdup((char*)pCurBlob); pCurBlob += mir_strlen((char*)pCurBlob) + 1;
+ szReason = mir_strdup((char*)pCurBlob);
+ }
+
__inline size_t size(){ return ((sizeof(DWORD) * 2) + (mir_strlen(szNick) + 1) + (mir_strlen(szFirstName) + 1) + (mir_strlen(szLastName) + 1) + (mir_strlen(szId) + 1) + (mir_strlen(szReason) + 1)); }
__inline operator char*(){ return (char*)makeBlob(); };
__inline operator BYTE*(){ return makeBlob(); };
+
+ __inline MCONTACT get_hcontact() { return hContact; }
+ __inline char *get_nick() { return mir_strdup(szNick); }
+ __inline char *get_firstname() { return mir_strdup(szFirstName); }
+ __inline char *get_lastname() { return mir_strdup(szLastName); }
+ __inline char *get_id() { return mir_strdup(szId); }
+ __inline char *get_reason() { return mir_strdup(szReason); }
};