summaryrefslogtreecommitdiff
path: root/protocols/Discord/src/guilds.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-11-26 14:41:11 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-11-26 14:41:21 +0300
commitbe1918c1b2986ddb387cd593deddf120f9e61874 (patch)
treecedf0b0983817b488edcc7eb604f2d44a75c935f /protocols/Discord/src/guilds.cpp
parent91c5b3baaf5ac2790a99015afcfbf696dff682ca (diff)
fix for chat structures declaration
Diffstat (limited to 'protocols/Discord/src/guilds.cpp')
-rw-r--r--protocols/Discord/src/guilds.cpp8
1 files changed, 4 insertions, 4 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);