summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-08-22 15:06:54 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-08-22 15:06:54 +0300
commitfdd4c3464bad72ca3b18b013fea6300b3233be2b (patch)
treea6a8cf654acec926dc7b5c635105c5020f7e12b6 /protocols/SkypeWeb/src
parent906a9d5f75f282a1ddd683f29346041c8f73e511 (diff)
fixes #4580 (Skypeweb: дабл-клик в клисте на групчат, который в оффлайне, работает неправильно)
Diffstat (limited to 'protocols/SkypeWeb/src')
-rw-r--r--protocols/SkypeWeb/src/skype_chatrooms.cpp15
-rw-r--r--protocols/SkypeWeb/src/skype_history_sync.cpp4
-rw-r--r--protocols/SkypeWeb/src/skype_proto.h2
3 files changed, 15 insertions, 6 deletions
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp
index e3249b18e3..0f04ba1793 100644
--- a/protocols/SkypeWeb/src/skype_chatrooms.cpp
+++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp
@@ -33,15 +33,22 @@ void CSkypeProto::InitGroupChatModule()
CreateProtoService(PS_LEAVECHAT, &CSkypeProto::OnLeaveChatRoom);
}
-SESSION_INFO* CSkypeProto::StartChatRoom(const wchar_t *tid, const wchar_t *tname)
+SESSION_INFO* CSkypeProto::StartChatRoom(const wchar_t *tid, const wchar_t *tname, const char *pszVersion)
{
// Create the group chat session
SESSION_INFO *si = Chat_NewSession(GCW_CHATROOM, m_szModuleName, tid, tname);
if (!si)
return nullptr;
- if (si->arUsers.getCount() == 0) {
- // Create a user statuses
+ bool bFetchInfo = si->arUsers.getCount() == 0;
+ if (pszVersion) {
+ CMStringA oldVersion(getMStringA(si->hContact, "Version"));
+ if (oldVersion != pszVersion)
+ bFetchInfo = true;
+ }
+
+ if (bFetchInfo) {
+ // Create user statuses
Chat_AddGroup(si, TranslateT("Admin"));
Chat_AddGroup(si, TranslateT("User"));
@@ -368,6 +375,8 @@ void CSkypeProto::OnGetChatInfo(MHttpResponse *response, AsyncHttpRequest*)
if (si == nullptr)
return;
+ setString(si->hContact, "Version", root["version"].as_string().c_str());
+
OBJLIST<char> arIds(1);
for (auto &member : root["members"]) {
CMStringW username(UrlToSkypeId(member["userLink"].as_mstring()));
diff --git a/protocols/SkypeWeb/src/skype_history_sync.cpp b/protocols/SkypeWeb/src/skype_history_sync.cpp
index e535374d2e..86616362e1 100644
--- a/protocols/SkypeWeb/src/skype_history_sync.cpp
+++ b/protocols/SkypeWeb/src/skype_history_sync.cpp
@@ -116,8 +116,8 @@ void CSkypeProto::OnSyncConversations(MHttpResponse *response, AsyncHttpRequest*
case 19:
{
auto &props = it["threadProperties"];
- if (props["members"] && !props["lastleaveat"])
- StartChatRoom(it["id"].as_mstring(), props["topic"].as_mstring());
+ if (props["membercount"].as_int() && !props["lastleaveat"])
+ StartChatRoom(it["id"].as_mstring(), props["topic"].as_mstring(), props["version"].as_string().c_str());
}
__fallthrough;
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h
index a22705c211..3d890f2eca 100644
--- a/protocols/SkypeWeb/src/skype_proto.h
+++ b/protocols/SkypeWeb/src/skype_proto.h
@@ -270,7 +270,7 @@ private:
INT_PTR __cdecl OnJoinChatRoom(WPARAM hContact, LPARAM);
INT_PTR __cdecl OnLeaveChatRoom(WPARAM hContact, LPARAM);
- SESSION_INFO* StartChatRoom(const wchar_t *tid, const wchar_t *tname);
+ SESSION_INFO* StartChatRoom(const wchar_t *tid, const wchar_t *tname, const char *pszVersion = nullptr);
bool OnChatEvent(const JSONNode &node);
wchar_t* GetChatContactNick(MCONTACT hContact, const wchar_t *id, const wchar_t *name = nullptr, bool *isQualified = nullptr);