summary refs log tree commit diff
diff options
context:
space:
mode:
authorLoren Burkholder <computersemiexpert@outlook.com>2021-09-04 20:53:33 -0400
committerLoren Burkholder <computersemiexpert@outlook.com>2021-09-11 19:35:31 -0400
commit356723fe0644f6e05f934262ea80dca2d33330c3 (patch)
treef19782f75471af15eab45321f492476fb0f9566d
parentFinish getting all avatars jdenticonified (diff)
downloadnheko-356723fe0644f6e05f934262ea80dca2d33330c3.tar.xz
Use more descriptive property name
-rw-r--r--resources/qml/RoomList.qml4
-rw-r--r--resources/qml/TopBar.qml2
-rw-r--r--src/timeline/RoomlistModel.cpp6
-rw-r--r--src/timeline/RoomlistModel.h2
-rw-r--r--src/timeline/TimelineModel.cpp4
-rw-r--r--src/timeline/TimelineModel.h6
6 files changed, 12 insertions, 12 deletions
diff --git a/resources/qml/RoomList.qml b/resources/qml/RoomList.qml

index 3b7fa84e..addbf571 100644 --- a/resources/qml/RoomList.qml +++ b/resources/qml/RoomList.qml
@@ -144,7 +144,7 @@ Page { required property bool hasLoudNotification required property bool hasUnreadMessages required property bool isDirect - required property string directChatAvatarMxid + required property string directChatOtherUserId color: background height: avatarSize + 2 * Nheko.paddingMedium @@ -239,7 +239,7 @@ Page { width: avatarSize url: avatarUrl.replace("mxc://", "image://MxcImage/") displayName: roomName - userid: isDirect ? directChatAvatarMxid : undefined + userid: isDirect ? directChatOtherUserId : "" roomid: roomId Rectangle { diff --git a/resources/qml/TopBar.qml b/resources/qml/TopBar.qml
index 78f81b7f..a8a53a24 100644 --- a/resources/qml/TopBar.qml +++ b/resources/qml/TopBar.qml
@@ -66,7 +66,7 @@ Rectangle { height: Nheko.avatarSize url: avatarUrl.replace("mxc://", "image://MxcImage/") roomid: room.roomId - userid: room.isDirect ? room.directChatAvatarMxid : undefined + userid: room.isDirect ? room.directChatOtherUserId : "" displayName: roomName onClicked: { if (room) diff --git a/src/timeline/RoomlistModel.cpp b/src/timeline/RoomlistModel.cpp
index d12fb426..094b0df6 100644 --- a/src/timeline/RoomlistModel.cpp +++ b/src/timeline/RoomlistModel.cpp
@@ -77,7 +77,7 @@ RoomlistModel::roleNames() const {Tags, "tags"}, {ParentSpaces, "parentSpaces"}, {IsDirect, "isDirect"}, - {DirectChatAvatarMxid, "directChatAvatarMxid"}, + {DirectChatOtherUserId, "directChatOtherUserId"}, }; } @@ -133,8 +133,8 @@ RoomlistModel::data(const QModelIndex &index, int role) const } case Roles::IsDirect: return room->isDirect(); - case Roles::DirectChatAvatarMxid: - return room->directChatAvatarMxid(); + case Roles::DirectChatOtherUserId: + return room->directChatOtherUserId(); default: return {}; } diff --git a/src/timeline/RoomlistModel.h b/src/timeline/RoomlistModel.h
index 57669087..c0a87aee 100644 --- a/src/timeline/RoomlistModel.h +++ b/src/timeline/RoomlistModel.h
@@ -66,7 +66,7 @@ public: Tags, ParentSpaces, IsDirect, - DirectChatAvatarMxid, + DirectChatOtherUserId, }; RoomlistModel(TimelineViewManager *parent = nullptr); diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp
index d5c39bbe..ca303040 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp
@@ -820,7 +820,7 @@ TimelineModel::syncState(const mtx::responses::State &s) if (roomMemberCount() <= 2) { emit isDirectChanged(); - emit directChatAvatarMxidChanged(); + emit directChatOtherUserIdChanged(); } } else if (std::holds_alternative<StateEvent<state::Encryption>>(e)) { this->isEncrypted_ = cache::isRoomEncrypted(room_id_.toStdString()); @@ -2080,7 +2080,7 @@ TimelineModel::roomMemberCount() const } QString -TimelineModel::directChatAvatarMxid() const +TimelineModel::directChatOtherUserId() const { if (roomMemberCount() < 3) { QString id; diff --git a/src/timeline/TimelineModel.h b/src/timeline/TimelineModel.h
index 03e33066..582c6b28 100644 --- a/src/timeline/TimelineModel.h +++ b/src/timeline/TimelineModel.h
@@ -178,7 +178,7 @@ class TimelineModel : public QAbstractListModel Q_PROPERTY(int trustlevel READ trustlevel NOTIFY trustlevelChanged) Q_PROPERTY(bool isDirect READ isDirect NOTIFY isDirectChanged) Q_PROPERTY( - QString directChatAvatarMxid READ directChatAvatarMxid NOTIFY directChatAvatarMxidChanged) + QString directChatOtherUserId READ directChatOtherUserId NOTIFY directChatOtherUserIdChanged) Q_PROPERTY(InputBar *input READ input CONSTANT) Q_PROPERTY(Permissions *permissions READ permissions NOTIFY permissionsChanged) @@ -296,7 +296,7 @@ public: crypto::Trust trustlevel() const; int roomMemberCount() const; bool isDirect() const { return roomMemberCount() <= 2; } // TODO: handle invites - QString directChatAvatarMxid() const; + QString directChatOtherUserId() const; std::optional<mtx::events::collections::TimelineEvents> eventById(const QString &id) { @@ -397,7 +397,7 @@ signals: void roomAvatarUrlChanged(); void roomMemberCountChanged(); void isDirectChanged(); - void directChatAvatarMxidChanged(); + void directChatOtherUserIdChanged(); void permissionsChanged(); void forwardToRoom(mtx::events::collections::TimelineEvents *e, QString roomId);