From 207c824ec7f32c97ff0baa7446d9f3c00217cf95 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Wed, 11 Jun 2025 22:19:59 +0200 Subject: [PATCH] Use QML safe member for invitations Has the sideeffect of making sure that the avatar colors are the same between the invitation view and the sidebar --- src/app/qml/InvitationView.qml | 2 +- src/libneochat/neochatroom.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/qml/InvitationView.qml b/src/app/qml/InvitationView.qml index 45242d9b8..f1a75ef8c 100644 --- a/src/app/qml/InvitationView.qml +++ b/src/app/qml/InvitationView.qml @@ -16,7 +16,7 @@ ColumnLayout { id: root required property NeoChatRoom currentRoom - readonly property var invitingMember: currentRoom.member(currentRoom.invitingUserId) + readonly property var invitingMember: currentRoom.qmlSafeMember(currentRoom.invitingUserId) readonly property string inviteTimestamp: root.currentRoom.inviteTimestamp.toLocaleString(Qt.locale(), Locale.ShortFormat) spacing: Kirigami.Units.smallSpacing diff --git a/src/libneochat/neochatroom.h b/src/libneochat/neochatroom.h index 02091bebb..d65044501 100644 --- a/src/libneochat/neochatroom.h +++ b/src/libneochat/neochatroom.h @@ -557,7 +557,7 @@ public: * responsibility of the caller to ensure that they only ask for objects * for real senders. */ - NeochatRoomMember *qmlSafeMember(const QString &memberId); + Q_INVOKABLE NeochatRoomMember *qmlSafeMember(const QString &memberId); /** * @brief Pin a message in the room.