pass message object through signal instead of just the id

This commit is contained in:
ouwou
2021-04-13 04:33:19 -04:00
parent 42d38a89b2
commit b6c6c03f87
7 changed files with 16 additions and 21 deletions

View File

@@ -299,12 +299,11 @@ ChannelList::ChannelList() {
// maybe will regret doing it this way
auto &discord = Abaddon::Get().GetDiscordClient();
auto cb = [this, &discord](Snowflake message_id) {
const auto message = discord.GetMessage(message_id);
const auto channel = discord.GetChannel(message->ChannelID);
auto cb = [this, &discord](const Message &message) {
const auto channel = discord.GetChannel(message.ChannelID);
if (!channel.has_value()) return;
if (channel->Type == ChannelType::DM || channel->Type == ChannelType::GROUP_DM)
CheckBumpDM(message->ChannelID);
CheckBumpDM(message.ChannelID);
};
discord.signal_message_create().connect(sigc::track_obj(cb, *this));
}