You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-29 16:43:09 +03:00
Add isUserIgnored convenience method
Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
@@ -780,6 +780,15 @@ MatrixClient.prototype.setIgnoredUsers = function(userIds, callback) {
|
||||
return this.setAccountData("m.ignored_user_list", content, callback);
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets whether or not a specific user is being ignored by this client.
|
||||
* @param {string} userId the user ID to check
|
||||
* @returns {boolean} true if the user is ignored, false otherwise
|
||||
*/
|
||||
MatrixClient.prototype.isUserIgnored = function(userId) {
|
||||
return this.getIgnoredUsers().indexOf(userId) !== -1;
|
||||
};
|
||||
|
||||
// Room operations
|
||||
// ===============
|
||||
|
||||
|
||||
Reference in New Issue
Block a user