1
0
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:
turt2live
2017-09-14 19:47:16 -06:00
parent b17dd8351f
commit b0ab8c750d

View File

@@ -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
// ===============