maybe slightly better image loading maybe hopefully

This commit is contained in:
ouwou
2020-10-03 18:49:22 -04:00
parent c7a958a3bb
commit bbe36a8246
7 changed files with 105 additions and 66 deletions

View File

@@ -210,11 +210,11 @@ void ChatWindow::ProcessNewMessage(Snowflake id, bool prepend) {
});
content->signal_image_load().connect([this, id](std::string url) {
auto &mgr = Abaddon::Get().GetImageManager();
mgr.LoadFromURL(url, [this, id](Glib::RefPtr<Gdk::Pixbuf> buf) {
mgr.LoadFromURL(url, [this, id, url](Glib::RefPtr<Gdk::Pixbuf> buf) {
if (m_id_to_widget.find(id) != m_id_to_widget.end()) {
auto *x = dynamic_cast<ChatMessageItemContainer *>(m_id_to_widget.at(id));
if (x != nullptr)
x->UpdateImage();
x->UpdateImage(url, buf);
}
});
});