summaryrefslogtreecommitdiff
path: root/protocols/Discord/src/guilds.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-06-04 19:22:10 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-06-04 19:22:10 +0300
commitd1ca910b36f431676d8c02667f69eb2f1cd2ae47 (patch)
tree13694d0e2d45992bd207896094780568e8ba57bc /protocols/Discord/src/guilds.cpp
parent83fa7b47ff82e9e308499fee387512f56a907854 (diff)
Discord: voice call initialization
Diffstat (limited to 'protocols/Discord/src/guilds.cpp')
-rw-r--r--protocols/Discord/src/guilds.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/protocols/Discord/src/guilds.cpp b/protocols/Discord/src/guilds.cpp
index 322a4ae9ed..d19615ef93 100644
--- a/protocols/Discord/src/guilds.cpp
+++ b/protocols/Discord/src/guilds.cpp
@@ -160,6 +160,9 @@ void CDiscordProto::ProcessGuild(const JSONNode &pRoot)
gm->iStatus = StrToStatus(it["status"].as_mstring());
}
+ for (auto &it : pRoot["voice_states"])
+ pGuild->arVoiceStates.insert(new CDiscordVoiceState(it));
+
for (auto &it : pGuild->arChatUsers)
AddGuildUser(pGuild, *it);
@@ -354,15 +357,23 @@ static int compareChatUsers(const CDiscordGuildMember *p1, const CDiscordGuildMe
return compareInt64(p1->userId, p2->userId);
}
+static int compareVoiceState(const CDiscordVoiceState *p1, const CDiscordVoiceState *p2)
+{
+ return compareInt64(p1->m_userId, p2->m_userId);
+}
+
CDiscordGuild::CDiscordGuild(SnowFlake _id) :
m_id(_id),
+ arRoles(10, compareRoles),
arChannels(10, compareUsers),
arChatUsers(30, compareChatUsers),
- arRoles(10, compareRoles)
+ arVoiceStates(10, compareVoiceState)
{}
CDiscordGuild::~CDiscordGuild()
-{}
+{
+ delete pVoiceCall;
+}
CDiscordUser::~CDiscordUser()
{