Fix rooms failing to load over dbus if image can't be downloaded

pull/1062/head
Nicolas Werner 3 years ago
parent af03138527
commit 6ead7b0ba2
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
  1. 4
      src/dbus/NhekoDBusBackend.cpp

@ -21,6 +21,8 @@ NhekoDBusBackend::NhekoDBusBackend(RoomlistModel *parent)
QVector<nheko::dbus::RoomInfoItem>
NhekoDBusBackend::rooms(const QDBusMessage &message)
{
message.setDelayedReply(true);
const auto roomListModel = m_parent->models;
QSharedPointer<QVector<nheko::dbus::RoomInfoItem>> model{
new QVector<nheko::dbus::RoomInfoItem>};
@ -43,8 +45,8 @@ NhekoDBusBackend::rooms(const QDBusMessage &message)
room->roomId(), alias, room->roomName(), image, room->notificationCount()});
if (model->length() == roomListModelSize) {
auto reply = message.createReply();
nhlog::ui()->debug("Sending {} rooms over D-Bus...", model->size());
auto reply = message.createReply();
reply << QVariant::fromValue(*model);
QDBusConnection::sessionBus().send(reply);
nhlog::ui()->debug("Rooms successfully sent to D-Bus.");

Loading…
Cancel
Save