summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-12-08 18:35:02 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-12-08 18:35:02 +0300
commit0b084cff5bb71a140d5181caa452a95b74ac8103 (patch)
treeb0394812fbed52040485f90a1815892ad4f565fa /protocols
parent7f1f391faf93d216bfe651131a95d70961f8ffa2 (diff)
chats:
- Chat_GetGroup & Chat_SetGroup functions added to stop the zoo with chat default group name; - fixes #1655 (custom chat group name doesn't work in Discord)
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Discord/src/guilds.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/protocols/Discord/src/guilds.cpp b/protocols/Discord/src/guilds.cpp
index b77f2b67b0..232d18d6bd 100644
--- a/protocols/Discord/src/guilds.cpp
+++ b/protocols/Discord/src/guilds.cpp
@@ -71,8 +71,13 @@ void CDiscordProto::ProcessRole(CDiscordGuild *guild, const JSONNode &role)
static void sttSetGroupName(MCONTACT hContact, const wchar_t *pwszGroupName)
{
ptrW wszOldName(db_get_wsa(hContact, "CList", "Group"));
- if (wszOldName == nullptr || !mir_wstrcmpi(wszOldName, TranslateT("Chat rooms")))
- db_set_ws(hContact, "CList", "Group", pwszGroupName);
+ if (wszOldName != nullptr) {
+ ptrW wszChatGroup(Chat_GetGroup());
+ if (mir_wstrcmpi(wszOldName, wszChatGroup))
+ return; // custom group, don't touch it
+ }
+
+ db_set_ws(hContact, "CList", "Group", pwszGroupName);
}
void CDiscordProto::BatchChatCreate(void *param)