From e164ace17434d7f21bd831f41211a9515feebeda Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Fri, 3 Apr 2015 12:02:42 +0000 Subject: notification when cotact typing git-svn-id: http://svn.miranda-ng.org/main/trunk@12587 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_poll_processing.cpp | 44 +++++++++++++++++------- 1 file changed, 31 insertions(+), 13 deletions(-) (limited to 'protocols/SkypeWeb/src/skype_poll_processing.cpp') diff --git a/protocols/SkypeWeb/src/skype_poll_processing.cpp b/protocols/SkypeWeb/src/skype_poll_processing.cpp index 803e37d5b0..c69722d93d 100644 --- a/protocols/SkypeWeb/src/skype_poll_processing.cpp +++ b/protocols/SkypeWeb/src/skype_poll_processing.cpp @@ -80,20 +80,38 @@ void CSkypeProto::ProcessNewMessageRes(JSONNODE *node) ptrA messagetype(mir_t2a(ptrT(json_as_string(json_get(node, "messagetype"))))); ptrA from(mir_t2a(ptrT(json_as_string(json_get(node, "from"))))); ptrA content(mir_t2a(ptrT(json_as_string(json_get(node, "content"))))); - //ptrA composeTime(mir_t2a(ptrT(json_as_string(json_get(node, "composetime"))))); TCHAR *composeTime = json_as_string (json_get(node, "composetime")); ptrA conversationLink(mir_t2a(ptrT(json_as_string(json_get(node, "conversationLink"))))); - time_t timeStamp = IsoToUnixTime(composeTime);//time(NULL); // it should be rewritten - - if (!mir_strcmpi(messagetype, "Text") || !mir_strcmpi(messagetype, "RichText")) { - PROTORECVEVENT recv = { 0 }; - recv.flags = PREF_UTF; - recv.timestamp = timeStamp; - recv.szMessage = content; - debugLogA("Incoming message from %s", ContactUrlToName(from)); - if (IsMe(ContactUrlToName(from))) - return; //it should be rewritten - MCONTACT hContact = GetContact(ContactUrlToName(from)); - OnReceiveMessage(hContact, &recv); + time_t timeStamp = IsoToUnixTime(composeTime); + char *convname; + if (strstr(conversationLink, "/19:")) + { + const char *chatname, *topic; + chatname = ContactUrlToName(conversationLink); + convname = mir_strdup(chatname); + return; //chats not supported + } + else if (strstr(conversationLink, "/8:")) + { + if (!mir_strcmpi(messagetype, "Control/Typing")) + { + MCONTACT hContact = GetContact(ContactUrlToName(from)); + CallService(MS_PROTO_CONTACTISTYPING, hContact, 5); + } + else if (!mir_strcmpi(messagetype, "Control/ClearTyping")) + { + return; + } + else if (!mir_strcmpi(messagetype, "Text") || !mir_strcmpi(messagetype, "RichText")) { + PROTORECVEVENT recv = { 0 }; + recv.flags = PREF_UTF; + recv.timestamp = timeStamp; + recv.szMessage = content; + debugLogA("Incoming message from %s", ContactUrlToName(from)); + if (IsMe(ContactUrlToName(from))) + return; //it should be rewritten + MCONTACT hContact = GetContact(ContactUrlToName(from)); + OnReceiveMessage(hContact, &recv); + } } } \ No newline at end of file -- cgit v1.2.3