diff options
author | George Hazan <ghazan@miranda.im> | 2021-05-13 21:46:59 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-05-13 21:46:59 +0300 |
commit | 4321bd81a30e8aaa9dfd5d29fb3135708fa3d123 (patch) | |
tree | 4355dfec4c186a5c53063fc598d6d82b78647ad8 /protocols/Discord | |
parent | 21833669fa44e8b8cee8dcb5779e14dc85990221 (diff) |
fixes #2878 (Discord: rename the "Disable group chats" option to "Disable guilds" and stop processing guilds at all)
Diffstat (limited to 'protocols/Discord')
-rw-r--r-- | protocols/Discord/res/discord.rc | 6 | ||||
-rw-r--r-- | protocols/Discord/src/dispatch.cpp | 8 | ||||
-rw-r--r-- | protocols/Discord/src/guilds.cpp | 3 | ||||
-rw-r--r-- | protocols/Discord/src/options.cpp | 2 | ||||
-rw-r--r-- | protocols/Discord/src/resource.h | 2 |
5 files changed, 13 insertions, 8 deletions
diff --git a/protocols/Discord/res/discord.rc b/protocols/Discord/res/discord.rc index 4a9b9e560f..6fac650624 100644 --- a/protocols/Discord/res/discord.rc +++ b/protocols/Discord/res/discord.rc @@ -79,7 +79,7 @@ BEGIN GROUPBOX "Contacts",IDC_STATIC,7,54,291,86 LTEXT "Default group:",IDC_STATIC,17,73,61,8,0,WS_EX_RIGHT EDITTEXT IDC_GROUP,84,71,123,13,ES_AUTOHSCROLL - CONTROL "Enable group chats",IDC_USECHANNELS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,90,275,10 + CONTROL "Enable guilds (servers)",IDC_USEGUILDS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,90,275,10 CONTROL "Do not open chat windows on creation",IDC_HIDECHATS, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,102,248,10 CONTROL "Use subgroups for server channels (requires restart)",IDC_USEGROUPS, @@ -124,6 +124,10 @@ BEGIN IDD_OPTIONS_ACCOUNT, DIALOG BEGIN END + + IDD_OPTIONS_ACCMGR, DIALOG + BEGIN + END END #endif // APSTUDIO_INVOKED 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 |