Show event type for hidden events
This commit is contained in:
@@ -28,6 +28,8 @@ TimelineDelegate {
|
||||
*/
|
||||
required property NeochatRoomMember author
|
||||
|
||||
required property string eventType
|
||||
|
||||
width: parent?.width
|
||||
rightPadding: NeoChatConfig.compactLayout && root.ListView.view.width >= Kirigami.Units.gridUnit * 20 ? Kirigami.Units.gridUnit * 2 + Kirigami.Units.largeSpacing : Kirigami.Units.largeSpacing
|
||||
|
||||
@@ -53,7 +55,7 @@ TimelineDelegate {
|
||||
}
|
||||
QQC2.Label {
|
||||
Layout.fillWidth: true
|
||||
text: root.author.displayName + " : " + root.eventId
|
||||
text: root.author.displayName + ": " + root.eventType + " " + root.eventId
|
||||
color: Kirigami.Theme.disabledTextColor
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
elide: Text.ElideRight
|
||||
|
||||
@@ -309,6 +309,10 @@ QVariant MessageModel::data(const QModelIndex &idx, int role) const
|
||||
return true;
|
||||
}
|
||||
|
||||
if (role == EventTypeRole) {
|
||||
return event.value().get().matrixType();
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -338,6 +342,7 @@ QHash<int, QByteArray> MessageModel::roleNames() const
|
||||
roles[MediaInfoRole] = "mediaInfo";
|
||||
roles[IsEditableRole] = "isEditable";
|
||||
roles[ShowAuthorRole] = "showAuthor";
|
||||
roles[EventTypeRole] = "eventType";
|
||||
return roles;
|
||||
}
|
||||
|
||||
|
||||
@@ -84,6 +84,7 @@ public:
|
||||
IsPendingRole, /**< Whether an event is waiting to be accepted by the server. */
|
||||
IsEditableRole, /**< Whether the event can be edited by the user. */
|
||||
ShowAuthorRole, /**< Whether the author of a message should be shown. */
|
||||
EventTypeRole, /**< The matrix event type of this message. */
|
||||
LastRole, // Keep this last
|
||||
};
|
||||
Q_ENUM(EventRoles)
|
||||
|
||||
Reference in New Issue
Block a user