diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2012-10-07 13:47:03 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2012-10-07 13:47:03 +0000 |
commit | 8aded02eb09d418873002ea6d3e41d4d700e7e07 (patch) | |
tree | a1c9e40687203ea16c271481b6e3e8459bf0eb09 /protocols/Skype/src/skype_database.cpp | |
parent | 9eff79c4337785d0f2efee63bc3121b3955d161e (diff) |
- added first approach of contfct adding/deleting
git-svn-id: http://svn.miranda-ng.org/main/trunk@1801 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_database.cpp')
-rw-r--r-- | protocols/Skype/src/skype_database.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/protocols/Skype/src/skype_database.cpp b/protocols/Skype/src/skype_database.cpp new file mode 100644 index 0000000000..b22c632be0 --- /dev/null +++ b/protocols/Skype/src/skype_database.cpp @@ -0,0 +1,55 @@ +#include "skype_proto.h"
+
+HANDLE CSkypeProto::AddDataBaseEvent(HANDLE hContact, WORD type, DWORD time, DWORD flags, DWORD cbBlob, PBYTE pBlob)
+{
+ DBEVENTINFO dbei = {0};
+
+ dbei.cbSize = sizeof(dbei);
+ dbei.szModule = this->m_szModuleName;
+ dbei.timestamp = time;
+ dbei.flags = flags;
+ dbei.eventType = type;
+ dbei.cbBlob = cbBlob;
+ dbei.pBlob = pBlob;
+
+ return (HANDLE)CallService(MS_DB_EVENT_ADD, (WPARAM)hContact, (LPARAM)&dbei);
+}
+
+void CSkypeProto::RaiseAuthRequestEvent(
+ DWORD timestamp,
+ const char* sid,
+ const char* nick,
+ const char* firstName,
+ const char* lastName,
+ const char* reason)
+{
+ PROTORECVEVENT pre = {0};
+
+ CCSDATA ccs = {0};
+ ccs.szProtoService = PSR_AUTH;
+ ccs.hContact = this->GetContactBySid(::mir_a2u(sid));
+ ccs.wParam = 0;
+ ccs.lParam = (LPARAM)⪯
+ pre.timestamp = timestamp;
+ pre.lParam = (DWORD)
+ (sizeof(DWORD) * 2) +
+ ::strlen(nick) +
+ ::strlen(firstName) +
+ ::strlen(lastName) +
+ ::strlen(sid) +
+ ::strlen(reason) +
+ 5;
+
+ /*blob is: 0(DWORD), hContact(DWORD), nick(ASCIIZ), firstName(ASCIIZ), lastName(ASCIIZ), sid(ASCIIZ), reason(ASCIIZ)*/
+ char *pCurBlob = pre.szMessage = (char*)::mir_alloc(pre.lParam);
+
+ *((PDWORD)pCurBlob) = 0; pCurBlob += sizeof(DWORD);
+ *((PDWORD)pCurBlob) = (DWORD)ccs.hContact; pCurBlob += sizeof(DWORD);
+ ::strcpy((char*)pCurBlob, nick); pCurBlob += ::strlen(nick) + 1;
+ ::strcpy((char*)pCurBlob, firstName); pCurBlob += ::strlen(sid) + 1;
+ ::strcpy((char*)pCurBlob, lastName); pCurBlob += ::strlen(sid) + 1;
+ ::strcpy((char*)pCurBlob, sid); pCurBlob += ::strlen(sid) + 1;
+ ::strcpy((char*)pCurBlob, reason);
+
+ ::CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+}
\ No newline at end of file |