summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-11-27 17:42:17 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-11-27 17:42:17 +0300
commit8a57ca7afd4cce23a6a9112a64e3a2aeee7d96be (patch)
tree3d0d33ff3fe66afb1bcf8bc820b3f109a1132754 /protocols
parente7bfa7d9faa1d4e328ca0727174cddc0ca0cd808 (diff)
Discord: fix for guild sync
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Discord/src/guilds.cpp6
-rw-r--r--protocols/Discord/src/proto.h1
2 files changed, 6 insertions, 1 deletions
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<CDiscordUser> arChannels;
SESSION_INFO *pParentSi;