aboutsummaryrefslogtreecommitdiff
path: root/lib/room.h
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-08-23 08:42:49 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-08-23 09:42:03 +0200
commit6953e55361f600a591c08b9cd287a350230b3ef8 (patch)
tree4c81e61712ef3bd8f978f9bb9f8ce4430f0367d6 /lib/room.h
parent2914657e594b46bcdc04d320732fa1799978c0a8 (diff)
downloadlibquotient-6953e55361f600a591c08b9cd287a350230b3ef8.tar.gz
libquotient-6953e55361f600a591c08b9cd287a350230b3ef8.zip
Room: isMember(); memberState() only needs user id
Room::memberJoinState() was only used to check if the user has joined the room (it couldn't be used for anything else), meaning that its best replacement is actually not memberState() but isMember() introduced hereby. It's also better to pass user ids instead of User objects to memberState() and isMember() since that is enough to check membership. # Conflicts: # lib/room.cpp # lib/room.h
Diffstat (limited to 'lib/room.h')
-rw-r--r--lib/room.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/room.h b/lib/room.h
index de0c7504..179295d0 100644
--- a/lib/room.h
+++ b/lib/room.h
@@ -240,13 +240,16 @@ public:
*
* \return Join if the user is a room member; Leave otherwise
*/
- Q_DECL_DEPRECATED_X("Use memberState and check against the mask") //
+ Q_DECL_DEPRECATED_X("Use isMember() instead")
Q_INVOKABLE Quotient::JoinState memberJoinState(Quotient::User* user) const;
//! \brief Check the join state of a given user in this room
//!
//! \return the given user's state with respect to the room
- Q_INVOKABLE Quotient::Membership memberState(User* user) const;
+ Q_INVOKABLE Quotient::Membership memberState(const QString& userId) const;
+
+ //! Check whether a user with the given id is a member of the room
+ Q_INVOKABLE bool isMember(const QString& userId) const;
//! \brief Get a display name (without disambiguation) for the given member
//!