summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorLcsTen <lcs10.twinoid@gmail.com>2023-03-18 12:46:44 +0100
committerLcsTen <lcs10.twinoid@gmail.com>2023-03-18 13:07:08 +0100
commitb3b5b6b3749f05a89ce3d2360ba9f0002f81a09e (patch)
tree25e21ca1510f86b176bd580949d7110952367e38 /src
parentShow an appropriate hint if the room is inaccessible (diff)
downloadnheko-b3b5b6b3749f05a89ce3d2360ba9f0002f81a09e.tar.xz
Check isPreviewFetched property for hints
Diffstat (limited to 'src')
-rw-r--r--src/timeline/RoomlistModel.cpp2
-rw-r--r--src/timeline/RoomlistModel.h4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/timeline/RoomlistModel.cpp b/src/timeline/RoomlistModel.cpp

index 17226977..12fee262 100644 --- a/src/timeline/RoomlistModel.cpp +++ b/src/timeline/RoomlistModel.cpp
@@ -796,11 +796,13 @@ RoomlistModel::setCurrentRoom(const QString &roomid) p.roomName_ = QString::fromStdString(i->name); p.roomTopic_ = QString::fromStdString(i->topic); p.roomAvatarUrl_ = QString::fromStdString(i->avatar_url); + p.isFetched_ = true; currentRoomPreview_ = std::move(p); nhlog::ui()->debug("Switched to (preview): {}", currentRoomPreview_->roomid_.toStdString()); } else { p.roomid_ = roomid; + p.isFetched_ = false; currentRoomPreview_ = p; nhlog::ui()->debug("Switched to (empty): {}", currentRoomPreview_->roomid_.toStdString()); diff --git a/src/timeline/RoomlistModel.h b/src/timeline/RoomlistModel.h
index 60d22cc0..cd1cdcaf 100644 --- a/src/timeline/RoomlistModel.h +++ b/src/timeline/RoomlistModel.h
@@ -32,6 +32,7 @@ class RoomPreview Q_PROPERTY(QString roomAvatarUrl READ roomAvatarUrl CONSTANT) Q_PROPERTY(QString reason READ reason CONSTANT) Q_PROPERTY(bool isInvite READ isInvite CONSTANT) + Q_PROPERTY(bool isFetched READ isFetched CONSTANT) public: RoomPreview() {} @@ -42,9 +43,10 @@ public: QString roomAvatarUrl() const { return roomAvatarUrl_; } QString reason() const { return reason_; } bool isInvite() const { return isInvite_; } + bool isFetched() const { return isFetched_; } QString roomid_, roomName_, roomAvatarUrl_, roomTopic_, reason_; - bool isInvite_ = false; + bool isInvite_ = false, isFetched_ = true; }; class RoomlistModel final : public QAbstractListModel