diff options
author | George Hazan <ghazan@miranda.im> | 2018-10-31 15:57:25 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-10-31 15:57:25 +0300 |
commit | 67a6c03577c66cb1b8cb69ad1f31b79fa7cc8a3c (patch) | |
tree | b70a883d3014c8641db2a9c46c2348949c58eb7f /protocols/Discord/src/guilds.cpp | |
parent | 4d8882c9c68f74ae41364995720517e7dff14d33 (diff) |
Discord: additional option to use special sub-groups for guilds
Diffstat (limited to 'protocols/Discord/src/guilds.cpp')
-rw-r--r-- | protocols/Discord/src/guilds.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/protocols/Discord/src/guilds.cpp b/protocols/Discord/src/guilds.cpp index c494d141ac..7e1c2b83b7 100644 --- a/protocols/Discord/src/guilds.cpp +++ b/protocols/Discord/src/guilds.cpp @@ -90,12 +90,14 @@ void CDiscordProto::CreateChat(CDiscordGuild *pGuild, CDiscordUser *pUser) si->pParent = pGuild->pParentSi; pUser->hContact = si->hContact; - if (pUser->parentId) { - CDiscordUser *pParent = FindUserByChannel(pUser->parentId); - if (pParent != nullptr) - sttSetGroupName(pUser->hContact, pParent->wszChannelName); + if (m_bUseGuildGroups) { + if (pUser->parentId) { + CDiscordUser *pParent = FindUserByChannel(pUser->parentId); + if (pParent != nullptr) + sttSetGroupName(pUser->hContact, pParent->wszChannelName); + } + else sttSetGroupName(pUser->hContact, Clist_GroupGetName(pGuild->groupId)); } - else sttSetGroupName(pUser->hContact, Clist_GroupGetName(pGuild->groupId)); BuildStatusList(pGuild, pUser->wszUsername); @@ -172,8 +174,10 @@ CDiscordUser* CDiscordProto::ProcessGuildChannel(CDiscordGuild *pGuild, const JS arUsers.insert(pUser); pGuild->arChannels.insert(pUser); - MGROUP grpId = Clist_GroupCreate(pGuild->groupId, wszName); - pUser->wszChannelName = Clist_GroupGetName(grpId); + if (m_bUseGuildGroups) { + MGROUP grpId = Clist_GroupCreate(pGuild->groupId, wszName); + pUser->wszChannelName = Clist_GroupGetName(grpId); + } } return pUser; @@ -191,7 +195,10 @@ CDiscordUser* CDiscordProto::ProcessGuildChannel(CDiscordGuild *pGuild, const JS pGuild->arChannels.insert(pUser); pUser->wszUsername = wszChannelId; - pUser->wszChannelName = L"#" + wszName; + if (m_bUseGuildGroups) + pUser->wszChannelName = L"#" + wszName; + else + pUser->wszChannelName = pGuild->wszName + L"#" + wszName; pUser->wszTopic = pch["topic"].as_mstring(); pUser->pGuild = pGuild; pUser->lastMsg = CDiscordMessage(::getId(pch["last_message_id"])); |