From abbbd9d70570dee1facbda48eb0de5eb415e0d57 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Sat, 6 Jul 2024 16:27:08 +0200 Subject: [PATCH] Use RoomMember object for code component --- src/qml/CodeMaximizeComponent.qml | 15 +-------------- src/roommanager.cpp | 2 +- src/roommanager.h | 4 ++-- src/timeline/CodeComponent.qml | 2 +- 4 files changed, 5 insertions(+), 18 deletions(-) diff --git a/src/qml/CodeMaximizeComponent.qml b/src/qml/CodeMaximizeComponent.qml index 8bd0856a1..84add4422 100644 --- a/src/qml/CodeMaximizeComponent.qml +++ b/src/qml/CodeMaximizeComponent.qml @@ -16,21 +16,8 @@ Components.AbstractMaximizeComponent { /** * @brief The message author. - * - * This should consist of the following: - * - id - The matrix ID of the author. - * - isLocalUser - Whether the author is the local user. - * - avatarSource - The mxc URL for the author's avatar in the current room. - * - avatarMediaId - The media ID of the author's avatar. - * - avatarUrl - The mxc URL for the author's avatar. - * - displayName - The display name of the author. - * - display - The name of the author. - * - color - The color for the author. - * - object - The Quotient::User object for the author. - * - * @sa Quotient::User */ - property var author + property RoomMember author /** * @brief The timestamp of the message. diff --git a/src/roommanager.cpp b/src/roommanager.cpp index 4428c1974..4825c87b8 100644 --- a/src/roommanager.cpp +++ b/src/roommanager.cpp @@ -172,7 +172,7 @@ void RoomManager::maximizeMedia(int index) Q_EMIT showMaximizedMedia(index); } -void RoomManager::maximizeCode(const QVariantMap &author, const QDateTime &time, const QString &codeText, const QString &language) +void RoomManager::maximizeCode(const RoomMember &author, const QDateTime &time, const QString &codeText, const QString &language) { if (codeText.isEmpty()) { return; diff --git a/src/roommanager.h b/src/roommanager.h index 74a4004a2..410f42aa1 100644 --- a/src/roommanager.h +++ b/src/roommanager.h @@ -204,7 +204,7 @@ public: */ Q_INVOKABLE void maximizeMedia(int index); - Q_INVOKABLE void maximizeCode(const QVariantMap &author, const QDateTime &time, const QString &codeText, const QString &language); + Q_INVOKABLE void maximizeCode(const RoomMember &author, const QDateTime &time, const QString &codeText, const QString &language); /** * @brief Request that any full screen overlay currently open closes. @@ -275,7 +275,7 @@ Q_SIGNALS: /** * @brief Request a block of code is shown maximized. */ - void showMaximizedCode(const QVariantMap &author, const QDateTime &time, const QString &codeText, const QString &language); + void showMaximizedCode(const RoomMember &author, const QDateTime &time, const QString &codeText, const QString &language); /** * @brief Request that any full screen overlay closes. diff --git a/src/timeline/CodeComponent.qml b/src/timeline/CodeComponent.qml index be55e88de..1972e6ee9 100644 --- a/src/timeline/CodeComponent.qml +++ b/src/timeline/CodeComponent.qml @@ -20,7 +20,7 @@ QQC2.Control { * * @sa Quotient::RoomMember */ - required property var author + required property RoomMember author /** * @brief The timestamp of the message.