summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--discord/discord.cpp8
-rw-r--r--windows/mainwindow.cpp2
2 files changed, 6 insertions, 4 deletions
diff --git a/discord/discord.cpp b/discord/discord.cpp
index 33a8e38..468fe94 100644
--- a/discord/discord.cpp
+++ b/discord/discord.cpp
@@ -544,9 +544,11 @@ void DiscordClient::HandleGatewayMessageUpdate(const GatewayMessage &msg) {
void DiscordClient::HandleGatewayGuildMemberListUpdate(const GatewayMessage &msg) {
GuildMemberListUpdateMessage data = msg.Data;
- // man
+
+ bool has_sync = false;
for (const auto &op : data.Ops) {
if (op.Op == "SYNC") {
+ has_sync = true;
for (const auto &item : op.Items) {
if (item->Type == "member") {
auto member = static_cast<const GuildMemberListUpdateMessage::MemberItem *>(item.get());
@@ -558,7 +560,9 @@ void DiscordClient::HandleGatewayGuildMemberListUpdate(const GatewayMessage &msg
}
}
- m_signal_guild_member_list_update.emit(data.GuildID);
+ // todo: manage this event a little better
+ if (has_sync)
+ m_signal_guild_member_list_update.emit(data.GuildID);
}
void DiscordClient::HandleGatewayGuildCreate(const GatewayMessage &msg) {
diff --git a/windows/mainwindow.cpp b/windows/mainwindow.cpp
index 74ead8f..e08f981 100644
--- a/windows/mainwindow.cpp
+++ b/windows/mainwindow.cpp
@@ -144,7 +144,6 @@ Snowflake MainWindow::GetChatActiveChannel() const {
void MainWindow::UpdateChatNewMessage(Snowflake id) {
if (Abaddon::Get().GetDiscordClient().GetMessage(id)->ChannelID == GetChatActiveChannel()) {
m_chat.AddNewMessage(id);
- m_members.UpdateMemberList();
}
}
@@ -160,7 +159,6 @@ void MainWindow::UpdateChatMessageUpdated(Snowflake id, Snowflake channel_id) {
void MainWindow::UpdateChatPrependHistory(const std::vector<Snowflake> &msgs) {
m_chat.AddNewHistory(msgs);
- m_members.UpdateMemberList();
}
void MainWindow::InsertChatInput(std::string text) {