move avatar stuff out of chatwindow

This commit is contained in:
ouwou
2020-11-18 16:25:10 -05:00
parent a0ece884d0
commit 1463d8da9e
3 changed files with 12 additions and 21 deletions

View File

@@ -192,19 +192,6 @@ void ChatWindow::ProcessNewMessage(Snowflake id, bool prepend) {
});
m_num_rows++;
Abaddon::Get().GetImageManager().LoadFromURL(user->GetAvatarURL("png", "32"), [this, user_id](Glib::RefPtr<Gdk::Pixbuf> buf) {
Glib::signal_idle().connect([this, buf, user_id]() -> bool {
auto children = m_list->get_children();
for (auto child : children) {
auto *row = dynamic_cast<ChatMessageHeader *>(child);
if (row == nullptr) continue;
if (row->UserID == user_id)
row->SetAvatarFromPixbuf(buf);
}
return false;
});
});
}
auto *content = CreateMessageComponent(id);