fix some lifetime stuff
This commit is contained in:
@@ -274,15 +274,14 @@ ChannelList::ChannelList() {
|
|||||||
|
|
||||||
// maybe will regret doing it this way
|
// maybe will regret doing it this way
|
||||||
auto &discord = Abaddon::Get().GetDiscordClient();
|
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 message = discord.GetMessage(message_id);
|
||||||
const auto channel = discord.GetChannel(message->ChannelID);
|
const auto channel = discord.GetChannel(message->ChannelID);
|
||||||
if (!channel.has_value()) return;
|
if (!channel.has_value()) return;
|
||||||
if (channel->Type == ChannelType::DM || channel->Type == ChannelType::GROUP_DM)
|
if (channel->Type == ChannelType::DM || channel->Type == ChannelType::GROUP_DM)
|
||||||
CheckBumpDM(message->ChannelID);
|
CheckBumpDM(message->ChannelID);
|
||||||
// clang-format off
|
};
|
||||||
}, this));
|
discord.signal_message_create().connect(sigc::track_obj(cb, *this));
|
||||||
// clang-format on
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Gtk::Widget *ChannelList::GetRoot() const {
|
Gtk::Widget *ChannelList::GetRoot() const {
|
||||||
|
@@ -443,11 +443,10 @@ Gtk::Widget *ChatMessageItemContainer::CreateStickerComponent(const StickerData
|
|||||||
auto &img = Abaddon::Get().GetImageManager();
|
auto &img = Abaddon::Get().GetImageManager();
|
||||||
|
|
||||||
if (data.FormatType == StickerFormatType::PNG || data.FormatType == StickerFormatType::APNG) {
|
if (data.FormatType == StickerFormatType::PNG || data.FormatType == StickerFormatType::APNG) {
|
||||||
// clang-format off
|
auto cb = [this, imgw](const Glib::RefPtr<Gdk::Pixbuf> &pixbuf) {
|
||||||
img.LoadFromURL(data.GetURL(), sigc::track_obj([this, imgw](const Glib::RefPtr<Gdk::Pixbuf> &pixbuf) {
|
|
||||||
imgw->property_pixbuf() = pixbuf;
|
imgw->property_pixbuf() = pixbuf;
|
||||||
}, imgw));
|
};
|
||||||
// clang-format on
|
img.LoadFromURL(data.GetURL(), sigc::track_obj(cb, *imgw));
|
||||||
}
|
}
|
||||||
|
|
||||||
AttachEventHandlers(*box);
|
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)));
|
img = Gtk::manage(new Gtk::Image(pb->scale_simple(16, 16, Gdk::INTERP_BILINEAR)));
|
||||||
} else {
|
} else {
|
||||||
img = Gtk::manage(new Gtk::Image(placeholder));
|
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));
|
imgr.LoadFromURL(reaction.Emoji.GetURL(), sigc::bind<0>(sigc::mem_fun(*this, &ChatMessageItemContainer::ReactionUpdateImage), img));
|
||||||
}
|
}
|
||||||
img->set_can_focus(false);
|
img->set_can_focus(false);
|
||||||
|
Reference in New Issue
Block a user