make dm member lists a bit better

This commit is contained in:
ouwou 2020-11-08 21:15:27 -05:00
parent 9fa59479aa
commit 0f47728c2a
2 changed files with 7 additions and 1 deletions

View File

@ -105,6 +105,7 @@ void MemberList::UpdateMemberListInternal() {
if (chan->Type == ChannelType::DM || chan->Type == ChannelType::GROUP_DM) {
for (const auto &user : chan->Recipients)
ids.insert(user.ID);
ids.insert(discord.GetUserData().ID);
} else {
ids = discord.GetUsersInGuild(m_guild_id);
}
@ -203,7 +204,10 @@ void MemberList::UpdateMemberListInternal() {
add_user(data);
}
add_role("@everyone");
if (chan->Type == ChannelType::DM || chan->Type == ChannelType::GROUP_DM)
add_role("Users");
else
add_role("@everyone");
for (const auto &id : roleless_users) {
const auto *user = discord.GetUser(id);
if (user != nullptr)

View File

@ -591,6 +591,8 @@ void DiscordClient::HandleGatewayReady(const GatewayMessage &msg) {
for (const auto &dm : data.PrivateChannels) {
m_store.SetChannel(dm.ID, dm);
for (const auto &recipient : dm.Recipients)
m_store.SetUser(recipient.ID, recipient);
}
m_signal_gateway_ready.emit();