diff options
-rw-r--r-- | components/channels.cpp | 7 | ||||
-rw-r--r-- | components/chatmessage.cpp | 8 |
2 files changed, 6 insertions, 9 deletions
diff --git a/components/channels.cpp b/components/channels.cpp index e9b85f9..667e138 100644 --- a/components/channels.cpp +++ b/components/channels.cpp @@ -274,15 +274,14 @@ ChannelList::ChannelList() { // maybe will regret doing it this way auto &discord = Abaddon::Get().GetDiscordClient(); - discord.signal_message_create().connect(sigc::track_obj([this, &discord](Snowflake message_id) { + auto cb = [this, &discord](Snowflake message_id) { const auto message = discord.GetMessage(message_id); 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); - // clang-format off - }, this)); - // clang-format on + }; + discord.signal_message_create().connect(sigc::track_obj(cb, *this)); } Gtk::Widget *ChannelList::GetRoot() const { diff --git a/components/chatmessage.cpp b/components/chatmessage.cpp index 7370073..08ca0b9 100644 --- a/components/chatmessage.cpp +++ b/components/chatmessage.cpp @@ -443,11 +443,10 @@ Gtk::Widget *ChatMessageItemContainer::CreateStickerComponent(const StickerData auto &img = Abaddon::Get().GetImageManager(); if (data.FormatType == StickerFormatType::PNG || data.FormatType == StickerFormatType::APNG) { - // clang-format off - img.LoadFromURL(data.GetURL(), sigc::track_obj([this, imgw](const Glib::RefPtr<Gdk::Pixbuf> &pixbuf) { + auto cb = [this, imgw](const Glib::RefPtr<Gdk::Pixbuf> &pixbuf) { imgw->property_pixbuf() = pixbuf; - }, imgw)); - // clang-format on + }; + img.LoadFromURL(data.GetURL(), sigc::track_obj(cb, *imgw)); } AttachEventHandlers(*box); @@ -521,7 +520,6 @@ Gtk::Widget *ChatMessageItemContainer::CreateReactionsComponent(const Message &d img = Gtk::manage(new Gtk::Image(pb->scale_simple(16, 16, Gdk::INTERP_BILINEAR))); } else { img = Gtk::manage(new Gtk::Image(placeholder)); - // can track_obj PLEASE work ??? imgr.LoadFromURL(reaction.Emoji.GetURL(), sigc::bind<0>(sigc::mem_fun(*this, &ChatMessageItemContainer::ReactionUpdateImage), img)); } img->set_can_focus(false); |