From 8a57ca7afd4cce23a6a9112a64e3a2aeee7d96be Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 27 Nov 2018 17:42:17 +0300 Subject: Discord: fix for guild sync --- protocols/Discord/src/guilds.cpp | 6 +++++- protocols/Discord/src/proto.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'protocols/Discord/src') diff --git a/protocols/Discord/src/guilds.cpp b/protocols/Discord/src/guilds.cpp index 639937b4c3..b77f2b67b0 100644 --- a/protocols/Discord/src/guilds.cpp +++ b/protocols/Discord/src/guilds.cpp @@ -122,9 +122,11 @@ void CDiscordProto::ProcessGuild(const JSONNode &p) if (pGuild == nullptr) { pGuild = new CDiscordGuild(guildId); arGuilds.insert(pGuild); + } + if (!pGuild->bSynced) GatewaySendGuildInfo(guildId); - } + pGuild->ownerId = ::getId(p["owner_id"]); pGuild->wszName = p["name"].as_mstring(); pGuild->groupId = Clist_GroupCreate(Clist_GroupExists(m_wszDefaultGroup), pGuild->wszName); @@ -292,4 +294,6 @@ void CDiscordProto::ParseGuildContents(CDiscordGuild *pGuild, const JSONNode &pR if (oldMsgId != 0 && it->lastMsgId > oldMsgId) RetrieveHistory(it->hContact, MSG_AFTER, oldMsgId, 99); } + + pGuild->bSynced = true; } diff --git a/protocols/Discord/src/proto.h b/protocols/Discord/src/proto.h index 44b50465a7..b092abaa04 100644 --- a/protocols/Discord/src/proto.h +++ b/protocols/Discord/src/proto.h @@ -116,6 +116,7 @@ struct CDiscordGuild : public MZeroedObject CMStringW wszName; MCONTACT hContact; MGROUP groupId; + bool bSynced = false; LIST arChannels; SESSION_INFO *pParentSi; -- cgit v1.2.3