diff options
Diffstat (limited to 'protocols/Discord/src')
-rw-r--r-- | protocols/Discord/src/guilds.cpp | 8 | ||||
-rw-r--r-- | protocols/Discord/src/stdafx.h | 2 |
2 files changed, 4 insertions, 6 deletions
diff --git a/protocols/Discord/src/guilds.cpp b/protocols/Discord/src/guilds.cpp index 31ce370f8d..cdaf29de05 100644 --- a/protocols/Discord/src/guilds.cpp +++ b/protocols/Discord/src/guilds.cpp @@ -71,7 +71,7 @@ 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) + if (wszOldName == nullptr || !mir_wstrcmpi(wszOldName, TranslateT("Chat rooms"))) db_set_ws(hContact, "CList", "Group", pwszGroupName); } @@ -80,13 +80,13 @@ void CDiscordProto::BatchChatCreate(void *param) CDiscordGuild *pGuild = (CDiscordGuild*)param; for (auto &it : pGuild->arChannels) - if (!it->bIsPrivate) + if (!it->bIsPrivate && !it->bIsGroup) CreateChat(pGuild, it); } void CDiscordProto::CreateChat(CDiscordGuild *pGuild, CDiscordUser *pUser) { - GCSessionInfoBase *si = Chat_NewSession(GCW_CHATROOM, m_szModuleName, pUser->wszUsername, pUser->wszChannelName); + SESSION_INFO *si = Chat_NewSession(GCW_CHATROOM, m_szModuleName, pUser->wszUsername, pUser->wszChannelName); si->pParent = pGuild->pParentSi; pUser->hContact = si->hContact; @@ -129,7 +129,7 @@ void CDiscordProto::ProcessGuild(const JSONNode &p) pGuild->wszName = p["name"].as_mstring(); pGuild->groupId = Clist_GroupCreate(Clist_GroupExists(m_wszDefaultGroup), pGuild->wszName); - GCSessionInfoBase *si = Chat_NewSession(GCW_SERVER, m_szModuleName, pGuild->wszName, pGuild->wszName, pGuild); + SESSION_INFO *si = Chat_NewSession(GCW_SERVER, m_szModuleName, pGuild->wszName, pGuild->wszName, pGuild); pGuild->pParentSi = (SESSION_INFO*)si; pGuild->hContact = si->hContact; setId(si->hContact, DB_KEY_CHANNELID, guildId); diff --git a/protocols/Discord/src/stdafx.h b/protocols/Discord/src/stdafx.h index 70bef09fe2..ccbd587d74 100644 --- a/protocols/Discord/src/stdafx.h +++ b/protocols/Discord/src/stdafx.h @@ -65,5 +65,3 @@ CMStringW PrepareMessageText(const JSONNode &pRoot); int StrToStatus(const CMStringW &str); time_t StringToDate(const CMStringW &str); int SerialNext(void); - -struct SESSION_INFO : public GCSessionInfoBase {}; |