summaryrefslogtreecommitdiff
path: root/protocols/Discord
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-09-22 12:46:10 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-09-22 12:46:10 +0300
commita70690cd406a7c5a34a5e589bb55cb2400be618e (patch)
tree2f501774936bfcad7ba757c18d600ae8c604c047 /protocols/Discord
parent8c2496120f46b59641cac79a431c51d12606a6dd (diff)
Discord: fix for empty guilds after relogin
Diffstat (limited to 'protocols/Discord')
-rw-r--r--protocols/Discord/src/guilds.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/protocols/Discord/src/guilds.cpp b/protocols/Discord/src/guilds.cpp
index bd19bca92f..8b8f250835 100644
--- a/protocols/Discord/src/guilds.cpp
+++ b/protocols/Discord/src/guilds.cpp
@@ -62,12 +62,13 @@ void CDiscordProto::ProcessRole(CDiscordGuild *guild, const JSONNode &role)
void CDiscordProto::ProcessGuild(const JSONNode &p)
{
SnowFlake guildId = ::getId(p["id"]);
- GatewaySendGuildInfo(guildId);
CDiscordGuild *pGuild = FindGuild(guildId);
if (pGuild == nullptr) {
pGuild = new CDiscordGuild(guildId);
arGuilds.insert(pGuild);
+
+ GatewaySendGuildInfo(guildId);
}
pGuild->ownerId = ::getId(p["owner_id"]);
pGuild->wszName = p["name"].as_mstring();
@@ -139,6 +140,9 @@ CDiscordUser* CDiscordProto::ProcessGuildChannel(CDiscordGuild *pGuild, const JS
if (oldMsgId != 0 && pUser->lastMsg.id > oldMsgId)
RetrieveHistory(pUser->hContact, MSG_AFTER, oldMsgId, 99);
+ for (int i = 0; i < pGuild->arChatUsers.getCount(); i++)
+ AddUserToChannel(*pUser, pGuild->arChatUsers[i]);
+
return pUser;
}