summaryrefslogtreecommitdiff
path: root/protocols/Discord/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-05-13 21:46:59 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-05-13 21:46:59 +0300
commit4321bd81a30e8aaa9dfd5d29fb3135708fa3d123 (patch)
tree4355dfec4c186a5c53063fc598d6d82b78647ad8 /protocols/Discord/src
parent21833669fa44e8b8cee8dcb5779e14dc85990221 (diff)
fixes #2878 (Discord: rename the "Disable group chats" option to "Disable guilds" and stop processing guilds at all)
Diffstat (limited to 'protocols/Discord/src')
-rw-r--r--protocols/Discord/src/dispatch.cpp8
-rw-r--r--protocols/Discord/src/guilds.cpp3
-rw-r--r--protocols/Discord/src/options.cpp2
-rw-r--r--protocols/Discord/src/resource.h2
4 files changed, 8 insertions, 7 deletions
diff --git a/protocols/Discord/src/dispatch.cpp b/protocols/Discord/src/dispatch.cpp
index 01ccef590f..4f2d25d35d 100644
--- a/protocols/Discord/src/dispatch.cpp
+++ b/protocols/Discord/src/dispatch.cpp
@@ -172,7 +172,8 @@ void CDiscordProto::OnCommandFriendRemoved(const JSONNode &pRoot)
void CDiscordProto::OnCommandGuildCreated(const JSONNode &pRoot)
{
- ProcessGuild(pRoot);
+ if (m_bUseGroupchats)
+ ProcessGuild(pRoot);
}
void CDiscordProto::OnCommandGuildDeleted(const JSONNode &pRoot)
@@ -505,8 +506,9 @@ void CDiscordProto::OnCommandReady(const JSONNode &pRoot)
m_szGatewaySessionId = pRoot["session_id"].as_mstring();
- for (auto &it : pRoot["guilds"])
- ProcessGuild(it);
+ if (m_bUseGroupchats)
+ for (auto &it : pRoot["guilds"])
+ ProcessGuild(it);
for (auto &it : pRoot["relationships"]) {
CDiscordUser *pUser = PrepareUser(it["user"]);
diff --git a/protocols/Discord/src/guilds.cpp b/protocols/Discord/src/guilds.cpp
index 4933c67389..e46d4e2c88 100644
--- a/protocols/Discord/src/guilds.cpp
+++ b/protocols/Discord/src/guilds.cpp
@@ -209,8 +209,7 @@ void CDiscordProto::ProcessGuild(const JSONNode &pRoot)
for (auto &it : pGuild->arChatUsers)
AddGuildUser(pGuild, *it);
- if (m_bUseGroupchats)
- ForkThread(&CDiscordProto::BatchChatCreate, pGuild);
+ ForkThread(&CDiscordProto::BatchChatCreate, pGuild);
pGuild->bSynced = true;
}
diff --git a/protocols/Discord/src/options.cpp b/protocols/Discord/src/options.cpp
index 3aeb657364..18474dbdea 100644
--- a/protocols/Discord/src/options.cpp
+++ b/protocols/Discord/src/options.cpp
@@ -31,7 +31,7 @@ public:
m_edGroup(this, IDC_GROUP),
m_edUserName(this, IDC_USERNAME),
m_edPassword(this, IDC_PASSWORD),
- chkUseChats(this, IDC_USECHANNELS),
+ chkUseChats(this, IDC_USEGUILDS),
chkHideChats(this, IDC_HIDECHATS),
chkUseGroups(this, IDC_USEGROUPS),
chkDeleteMsgs(this, IDC_DELETE_MSGS),
diff --git a/protocols/Discord/src/resource.h b/protocols/Discord/src/resource.h
index 6f300e73af..d0326e6857 100644
--- a/protocols/Discord/src/resource.h
+++ b/protocols/Discord/src/resource.h
@@ -15,7 +15,7 @@
#define IDC_NICK 1004
#define IDC_HIDECHATS 1005
#define IDC_USEGROUPS 1006
-#define IDC_USECHANNELS 1007
+#define IDC_USEGUILDS 1007
#define IDC_DELETE_MSGS 1009
// Next default values for new objects