summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-04-22 12:24:49 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-04-22 12:24:49 +0000
commit7e45d8a15069e165f093d03824300591d7014653 (patch)
tree06d0b3c8c31b96bc42202b67fdc17188732e31b3 /protocols
parentdc7a8b1f54463500d2c13339829db6c665f097da (diff)
SkypeWeb: fix chatrooms loading (?)
git-svn-id: http://svn.miranda-ng.org/main/trunk@16745 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/SkypeWeb/src/http_request.h2
-rw-r--r--protocols/SkypeWeb/src/requests/chatrooms.h2
-rw-r--r--protocols/SkypeWeb/src/skype_chatrooms.cpp14
-rw-r--r--protocols/SkypeWeb/src/stdafx.h1
4 files changed, 8 insertions, 11 deletions
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"