Store NeochatRoomMember objects in the room

Store NeochatRoomMember objects in the room so we don't duplicate them unnecessarily. This also adds a visible property for a room which is set true when shown by MessageEventModel and false when not, triggering the deletion of member objects. This mechanism will be used for other object types in the future.
This commit is contained in:
James Graham
2025-01-05 11:06:42 +00:00
parent 3dbe605de8
commit c21e9f2114
5 changed files with 74 additions and 18 deletions

View File

@@ -113,8 +113,8 @@ Q_SIGNALS:
private:
QPointer<NeoChatRoom> m_room;
QString m_eventId;
QString m_eventSenderId;
std::unique_ptr<NeochatRoomMember> m_eventSenderObject = nullptr;
QString senderId() const;
NeochatRoomMember *senderObject() const;
MessageState m_currentState = Unknown;
bool m_showAuthor = true;