From 56427b8057db532ca0887e14e71cb0071dcc6903 Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Wed, 3 Sep 2014 11:17:58 +0200 Subject: Added /ban command --- webclient/components/matrix/matrix-service.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'webclient/components') diff --git a/webclient/components/matrix/matrix-service.js b/webclient/components/matrix/matrix-service.js index 2ae55bea9f..869c1f731d 100644 --- a/webclient/components/matrix/matrix-service.js +++ b/webclient/components/matrix/matrix-service.js @@ -165,6 +165,17 @@ angular.module('matrixService', []) // TODO: Use PUT with transaction IDs return doRequest("POST", path, undefined, data); }, + + // Bans a user from from a room + ban: function(room_id, user_id, reason) { + var path = "/rooms/$room_id/ban/"; + path = path.replace("$room_id", encodeURIComponent(room_id)); + + return doRequest("PUT", path, undefined, { + user_id: user_id, + reason: reason + }); + }, // Retrieves the room ID corresponding to a room alias resolveRoomAlias:function(room_alias) { @@ -408,7 +419,8 @@ angular.module('matrixService', []) state: presence }); }, - + + /****** Permanent storage of user information ******/ // Returns the current config -- cgit 1.5.1