From 3f403397d35d601078423e84d61ab0c1cce6203e Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Fri, 20 Mar 2015 20:17:29 +0000 Subject: SkypeWeb: added auth requests management git-svn-id: http://svn.miranda-ng.org/main/trunk@12456 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_proto.cpp | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'protocols/SkypeWeb/src/skype_proto.cpp') 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; } -- cgit v1.2.3