Fix avatar not being set for some rooms in the top bar

This commit is contained in:
Nicolas Werner 2020-03-22 18:14:53 +01:00
parent b25e481418
commit 7df6529310

View file

@ -717,11 +717,8 @@ ChatPage::changeTopRoomInfo(const QString &room_id)
top_bar_->updateRoomName(name); top_bar_->updateRoomName(name);
top_bar_->updateRoomTopic(QString::fromStdString(room_info[room_id].topic)); top_bar_->updateRoomTopic(QString::fromStdString(room_info[room_id].topic));
auto img = cache::getRoomAvatar(room_id); top_bar_->updateRoomAvatarFromName(name);
if (!avatar_url.isEmpty())
if (img.isNull())
top_bar_->updateRoomAvatarFromName(name);
else
top_bar_->updateRoomAvatar(avatar_url); top_bar_->updateRoomAvatar(avatar_url);
} catch (const lmdb::error &e) { } catch (const lmdb::error &e) {