diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-30 13:11:42 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-30 13:11:42 +0000 |
commit | ea9403c8ff0b188f74f0fe2d101c4497485dbdaa (patch) | |
tree | a1a5bbf8b485dc1a440bdfc9c55402a949daab4c /protocols/SkypeWeb/src/skype_trouter.cpp | |
parent | 2aa1775c7bbba890746d13aa155c77a781304f7a (diff) |
SkypeWeb: Notification on incoming call.
git-svn-id: http://svn.miranda-ng.org/main/trunk@13289 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_trouter.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_trouter.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/protocols/SkypeWeb/src/skype_trouter.cpp b/protocols/SkypeWeb/src/skype_trouter.cpp index 2e0c24d996..06c09a72c8 100644 --- a/protocols/SkypeWeb/src/skype_trouter.cpp +++ b/protocols/SkypeWeb/src/skype_trouter.cpp @@ -89,6 +89,16 @@ void CSkypeProto::OnHealth(const NETLIBHTTPREQUEST *response) SendRequest(new GetTrouterRequest(socketIo, connId, st, se, sig, instance, ccid), &CSkypeProto::OnGetTrouter);
}
+void CSkypeProto::OnTrouterEvent(JSONNODE *body, JSONNODE *headers)
+{
+ ptrT displayname(json_as_string(json_get(body, "displayName")));
+ ptrT uid(json_as_string(json_get(body, "conversationId")));
+
+ MCONTACT hContact = FindContact(_T2A(uid));
+ if (hContact != NULL)
+ AddCallToDb(hContact, time(NULL), 0);
+}
+
void CSkypeProto::TRouterThread(void*)
{
debugLogA(__FUNCTION__": entering");
@@ -133,14 +143,8 @@ void CSkypeProto::TRouterThread(void*) JSONROOT root(json);
ptrA szBody(mir_t2a(ptrT(json_as_string(json_get(root, "body")))));
JSONNODE *headers = json_get(root, "headers");
-
JSONROOT jsonBody(szBody);
-
- ptrT displayname(json_as_string(json_get(jsonBody, "displayName")));
- ptrT uid(json_as_string(json_get(jsonBody, "conversationId")));
- MCONTACT hContact = FindContact(_T2A(uid));
- if (uid != NULL)
- ShowNotification(uid, TranslateT("Incoming call"), 0, hContact);
+ OnTrouterEvent(jsonBody, headers);
}
m_TrouterConnection = response->nlc;
|