update pins window on pin/unpin

This commit is contained in:
ouwou
2021-06-23 02:09:07 -04:00
parent 7db2675087
commit 41d60e5e90
6 changed files with 61 additions and 4 deletions

View File

@@ -21,9 +21,19 @@ PinnedWindow::PinnedWindow(const ChannelData &data)
m_chat.SetActiveChannel(ChannelID);
m_chat.SetUsePinnedMenu();
Abaddon::Get().GetDiscordClient().signal_message_pinned().connect(sigc::mem_fun(*this, &PinnedWindow::OnMessagePinned));
Abaddon::Get().GetDiscordClient().signal_message_unpinned().connect(sigc::mem_fun(*this, &PinnedWindow::OnMessageUnpinned));
FetchPinned();
}
void PinnedWindow::OnMessagePinned(const Message &msg) {
FetchPinned();
}
void PinnedWindow::OnMessageUnpinned(const Message &msg) {
m_chat.ActuallyRemoveMessage(msg.ID);
}
void PinnedWindow::FetchPinned() {
Abaddon::Get().GetDiscordClient().FetchPinned(ChannelID, sigc::mem_fun(*this, &PinnedWindow::OnFetchedPinned));
}