From 7e45d8a15069e165f093d03824300591d7014653 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Fri, 22 Apr 2016 12:24:49 +0000 Subject: SkypeWeb: fix chatrooms loading (?) git-svn-id: http://svn.miranda-ng.org/main/trunk@16745 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/http_request.h | 2 +- protocols/SkypeWeb/src/requests/chatrooms.h | 2 +- protocols/SkypeWeb/src/skype_chatrooms.cpp | 14 +++++--------- protocols/SkypeWeb/src/stdafx.h | 1 + 4 files changed, 8 insertions(+), 11 deletions(-) (limited to 'protocols') diff --git a/protocols/SkypeWeb/src/http_request.h b/protocols/SkypeWeb/src/http_request.h index b9aa13d7dc..5dfb061d70 100644 --- a/protocols/SkypeWeb/src/http_request.h +++ b/protocols/SkypeWeb/src/http_request.h @@ -263,7 +263,7 @@ public: mir_free(headers); } - NETLIBHTTPREQUEST* Send(HANDLE hConnection) + virtual NETLIBHTTPREQUEST* Send(HANDLE hConnection) { if (url.Find("://") == -1) url.Insert(0, ((flags & NLHRF_SSL) ? "https://" : "http://")); diff --git a/protocols/SkypeWeb/src/requests/chatrooms.h b/protocols/SkypeWeb/src/requests/chatrooms.h index 6197e40ff2..c9451cf6a2 100644 --- a/protocols/SkypeWeb/src/requests/chatrooms.h +++ b/protocols/SkypeWeb/src/requests/chatrooms.h @@ -115,7 +115,7 @@ class GetChatInfoRequest : public HttpRequest { public: GetChatInfoRequest(const char *chatId, LoginInfo &li) : - HttpRequest(REQUEST_GET, FORMAT, "%s/v1/threads/19:%s", li.endpoint.szServer, chatId) + HttpRequest(REQUEST_GET, FORMAT, "%s/v1/threads/%s%s", li.endpoint.szServer, strstr(chatId, "19:") == chatId ? "" : "19:", chatId) { Url << CHAR_VALUE("view", "msnp24Equivalent"); diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index 9e6506e015..7c052adb32 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -119,18 +119,14 @@ void CSkypeProto::OnLoadChats(const NETLIBHTTPREQUEST *response) for (size_t i = 0; i < conversations.size(); i++) { const JSONNode &conversation = conversations.at(i); - const JSONNode &lastMessage = conversation["lastMessage"]; const JSONNode &threadProperties = conversation["threadProperties"]; - if (!lastMessage) + const JSONNode &id = conversation["id"]; + + if (!conversation["lastMessage"]) continue; - std::string conversationLink = lastMessage["conversationLink"].as_string(); - if (conversationLink.find("/19:") != -1) - { - CMStringA skypename(UrlToSkypename(conversationLink.c_str())); - CMString topic(threadProperties["topic"].as_mstring()); - SendRequest(new GetChatInfoRequest(skypename, li), &CSkypeProto::OnGetChatInfo, topic.Detach()); - } + CMString topic(threadProperties["topic"].as_mstring()); + SendRequest(new GetChatInfoRequest(id.as_string().c_str(), li), &CSkypeProto::OnGetChatInfo, topic.Detach()); } } diff --git a/protocols/SkypeWeb/src/stdafx.h b/protocols/SkypeWeb/src/stdafx.h index 1422b847a5..d05dd7b44e 100644 --- a/protocols/SkypeWeb/src/stdafx.h +++ b/protocols/SkypeWeb/src/stdafx.h @@ -101,6 +101,7 @@ struct MessageId HANDLE handle; }; +//#include "websocket.h" #include "version.h" #include "resource.h" #include "skype_menus.h" -- cgit v1.2.3