diff --git a/src/neochatroom.cpp b/src/neochatroom.cpp index 733b0d547..876b3f919 100644 --- a/src/neochatroom.cpp +++ b/src/neochatroom.cpp @@ -1729,10 +1729,6 @@ void NeoChatRoom::setRoomState(const QString &type, const QString &stateKey, con NeochatRoomMember *NeoChatRoom::qmlSafeMember(const QString &memberId) { - if (!isMember(memberId)) { - return nullptr; - } - if (!m_memberObjects.contains(memberId)) { return m_memberObjects.emplace(memberId, std::make_unique(this, memberId)).first->second.get(); } diff --git a/src/neochatroom.h b/src/neochatroom.h index 97367f488..062f938cd 100644 --- a/src/neochatroom.h +++ b/src/neochatroom.h @@ -588,6 +588,15 @@ public: */ Quotient::FileTransferInfo cachedFileTransferInfo(const Quotient::RoomEvent *event) const; + /** + * @brief Return a NeochatRoomMember object for the given user ID. + * + * @warning Because we can't guarantee that a member state event is downloaded + * before a message they sent arrives this will create the object unconditionally + * assuming that the state event will turn up later. It is therefor the + * responsibility of the caller to ensure that they only ask for objects + * for real senders. + */ NeochatRoomMember *qmlSafeMember(const QString &memberId); /**