summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/SkypeWeb/src/skype_poll_processing.cpp44
-rw-r--r--protocols/SkypeWeb/src/skype_polling.cpp1
-rw-r--r--protocols/SkypeWeb/src/skype_proto.cpp10
3 files changed, 32 insertions, 23 deletions
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
diff --git a/protocols/SkypeWeb/src/skype_polling.cpp b/protocols/SkypeWeb/src/skype_polling.cpp
index c9dda8f31a..668359667f 100644
--- a/protocols/SkypeWeb/src/skype_polling.cpp
+++ b/protocols/SkypeWeb/src/skype_polling.cpp
@@ -38,7 +38,6 @@ void CSkypeProto::ParsePollData(JSONNODE *data)
{
continue;
}
-
}
}
}
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp
index 88a9241d0f..69d8eed9fc 100644
--- a/protocols/SkypeWeb/src/skype_proto.cpp
+++ b/protocols/SkypeWeb/src/skype_proto.cpp
@@ -187,15 +187,7 @@ int CSkypeProto::SetAwayMsg(int, const PROTOCHAR *msg) { return 0; }
int CSkypeProto::UserIsTyping(MCONTACT hContact, int type)
{
- switch (type) {
- case PROTOTYPE_SELFTYPING_OFF:
- PushRequest(new SendTypingRequest(getStringA("registrationToken"), db_get_sa(hContact, m_szModuleName, "Skypename"), false, getStringA("Server")));
- break;
- case PROTOTYPE_SELFTYPING_ON:
- PushRequest(new SendTypingRequest(getStringA("registrationToken"), db_get_sa(hContact, m_szModuleName, "Skypename"), true, getStringA("Server")));
- break;
- }
- return 0;
+ return 0;
}
int CSkypeProto::OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam)