diff options
author | George Hazan <george.hazan@gmail.com> | 2024-06-04 19:22:10 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-06-04 19:22:10 +0300 |
commit | d1ca910b36f431676d8c02667f69eb2f1cd2ae47 (patch) | |
tree | 13694d0e2d45992bd207896094780568e8ba57bc /protocols/Discord/src/guilds.cpp | |
parent | 83fa7b47ff82e9e308499fee387512f56a907854 (diff) |
Discord: voice call initialization
Diffstat (limited to 'protocols/Discord/src/guilds.cpp')
-rw-r--r-- | protocols/Discord/src/guilds.cpp | 15 |
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()
{
|