summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_proto.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-04-14 12:35:37 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-04-14 12:35:37 +0000
commitfff952e50f44761fa85ca90819ac97c47e77b553 (patch)
tree156381ae99a3f4bae3dc42b2bc24650f67daa5a7 /protocols/SkypeWeb/src/skype_proto.cpp
parent67228766fe401efef624b9c24a14d2fb5248e56c (diff)
SkypeWeb: More improvements.
git-svn-id: http://svn.miranda-ng.org/main/trunk@12802 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_proto.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_proto.cpp32
1 files changed, 26 insertions, 6 deletions
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp
index aa041f1019..1f363811ca 100644
--- a/protocols/SkypeWeb/src/skype_proto.cpp
+++ b/protocols/SkypeWeb/src/skype_proto.cpp
@@ -86,6 +86,7 @@ MCONTACT CSkypeProto::AddToList(int flags, PROTOSEARCHRESULT *psr)
{
debugLogA("CSkypeProto::AddToList");
+
ptrA skypeName(mir_t2a(ptrT(psr->id)));
if (skypeName == NULL)
return NULL;
@@ -101,7 +102,7 @@ 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));
@@ -125,9 +126,22 @@ int CSkypeProto::AuthRecv(MCONTACT, PROTORECVEVENT* pre)
return Proto_AuthRecv(m_szModuleName, pre);
}
+int CSkypeProto::AuthRequest(MCONTACT hContact, const PROTOCHAR *szMessage)
+{
+ if (hContact == INVALID_CONTACT_ID)
+ return 1;
+
+ ptrA token(getStringA("TokenSecret"));
+ ptrA skypename(getStringA(hContact, SKYPE_SETTINGS_ID));
+ PushRequest(new AddContactRequest(token, skypename, ptrA(mir_t2a(szMessage))));
+ return 0;
+}
+
int CSkypeProto::GetInfo(MCONTACT hContact, int)
{
- PushRequest(new GetProfileRequest(ptrA(getStringA("TokenSecret")), ptrA(db_get_sa(hContact, m_szModuleName, SKYPE_SETTINGS_ID))), &CSkypeProto::LoadProfile);
+ PushRequest(
+ new GetProfileRequest(ptrA(getStringA("TokenSecret")), ptrA(db_get_sa(hContact, m_szModuleName, SKYPE_SETTINGS_ID))),
+ &CSkypeProto::LoadProfile);
return 0;
}
@@ -205,10 +219,16 @@ int CSkypeProto::SetStatus(int iNewStatus)
int CSkypeProto::UserIsTyping(MCONTACT hContact, int type)
{
- ptrA regToken(getStringA("registrationToken"));
- ptrA username(getStringA(hContact, SKYPE_SETTINGS_ID));
- ptrA server(getStringA("Server"));
- PushRequest(new SendTypingRequest(regToken, username, type, server));
+ PushRequest
+ (
+ new SendTypingRequest
+ (
+ ptrA(getStringA("registrationToken")),
+ ptrA(getStringA(hContact, SKYPE_SETTINGS_ID)),
+ type,
+ ptrA(getStringA("Server"))
+ )
+ );
return 0;
}