summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_proto.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-03-20 20:17:29 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-03-20 20:17:29 +0000
commit3f403397d35d601078423e84d61ab0c1cce6203e (patch)
tree5060c0a07e7139148d9d0f1700288dd5e6b004f9 /protocols/SkypeWeb/src/skype_proto.cpp
parent1e8dbc1ff44b65c0fbe4e83fa5a22641c9ab9f47 (diff)
SkypeWeb: added auth requests management
git-svn-id: http://svn.miranda-ng.org/main/trunk@12456 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_proto.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_proto.cpp33
1 files changed, 29 insertions, 4 deletions
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp
index 4efd89426d..b566b1c245 100644
--- a/protocols/SkypeWeb/src/skype_proto.cpp
+++ b/protocols/SkypeWeb/src/skype_proto.cpp
@@ -31,11 +31,13 @@ DWORD_PTR CSkypeProto::GetCaps(int type, MCONTACT)
switch (type)
{
case PFLAGNUM_1:
- return 0;
+ return PF1_AUTHREQ;
case PFLAGNUM_2:
return PF2_ONLINE;
case PFLAGNUM_3:
return PF2_ONLINE;
+ case PFLAGNUM_4:
+ return PF4_FORCEADDED | PF4_NOAUTHDENYREASON;
case PFLAG_UNIQUEIDTEXT:
return (INT_PTR)"Skypename";
case PFLAG_UNIQUEIDSETTING:
@@ -49,11 +51,34 @@ MCONTACT CSkypeProto::AddToList(int flags, PROTOSEARCHRESULT *psr) { return 0; }
MCONTACT CSkypeProto::AddToListByEvent(int, int, MEVENT) { return 0; }
-int CSkypeProto::Authorize(MEVENT hDbEvent) { return 0; }
+int CSkypeProto::Authorize(MEVENT hDbEvent)
+{
+ MCONTACT hContact = GetContactFromAuthEvent(hDbEvent);
+ if (hContact == INVALID_CONTACT_ID)
+ return 1;
+
+ ptrA token(getStringA("TokenSecret"));
+ ptrA skypename(getStringA(hContact, SKYPE_SETTINGS_ID));
+ PushRequest(new AuthAcceptRequest(token, skypename));
+ return 0;
+}
-int CSkypeProto::AuthDeny(MEVENT, const PROTOCHAR*) { return 0; }
+int CSkypeProto::AuthDeny(MEVENT hDbEvent, const PROTOCHAR*)
+{
+ MCONTACT hContact = GetContactFromAuthEvent(hDbEvent);
+ if (hContact == INVALID_CONTACT_ID)
+ return 1;
-int CSkypeProto::AuthRecv(MCONTACT, PROTORECVEVENT* pre) { return 0; }
+ ptrA token(getStringA("TokenSecret"));
+ ptrA skypename(getStringA(hContact, SKYPE_SETTINGS_ID));
+ PushRequest(new AuthDeclineRequest(token, skypename));
+ return 0;
+}
+
+int CSkypeProto::AuthRecv(MCONTACT, PROTORECVEVENT* pre)
+{
+ return Proto_AuthRecv(m_szModuleName, pre);
+}
int CSkypeProto::AuthRequest(MCONTACT hContact, const PROTOCHAR *szMessage) { return 0; }