summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}