forked from OpenGamers/abaddon
mark channels as unread on MESSAGE_CREATE
This commit is contained in:
parent
1ea2811713
commit
d63941797f
@ -699,10 +699,11 @@ void ChannelList::OnMessageAck(const MessageAckData &data) {
|
||||
}
|
||||
|
||||
void ChannelList::OnMessageCreate(const Message &msg) {
|
||||
auto iter = GetIteratorForChannelFromID(msg.ChannelID);
|
||||
m_model->row_changed(m_model->get_path(iter), iter); // redraw
|
||||
const auto channel = Abaddon::Get().GetDiscordClient().GetChannel(msg.ChannelID);
|
||||
if (!channel.has_value()) return;
|
||||
if (channel->Type != ChannelType::DM && channel->Type != ChannelType::GROUP_DM) return;
|
||||
auto iter = GetIteratorForChannelFromID(msg.ChannelID);
|
||||
if (iter)
|
||||
(*iter)[m_columns.m_sort] = -msg.ID;
|
||||
}
|
||||
|
@ -1444,6 +1444,9 @@ void DiscordClient::HandleGatewayMessageCreate(const GatewayMessage &msg) {
|
||||
if (data.GuildID.has_value())
|
||||
AddUserToGuild(data.Author.ID, *data.GuildID);
|
||||
m_last_message_id[data.ChannelID] = data.ID;
|
||||
const auto iter = m_unread.find(data.ChannelID);
|
||||
if (iter == m_unread.end())
|
||||
m_unread[data.ChannelID] = 0;
|
||||
m_signal_message_create.emit(data);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user