From 6570402b95d015a5b2f8e2b362d317c93e145f81 Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Thu, 3 May 2018 13:42:33 +0100 Subject: [PATCH 1/4] Add getMediaLimits to client --- src/client.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/client.js b/src/client.js index 892e144f1..4af13ba44 100644 --- a/src/client.js +++ b/src/client.js @@ -727,6 +727,20 @@ MatrixClient.prototype.getGroups = function() { return this.store.getGroups(); }; +/** + * Get the room for the given room ID. + * This function will return a valid room for any room for which a Room event + * has been emitted. Note in particular that other events, eg. RoomState.members + * will be emitted for a room before this function will return the given room. + * @param {module:client.callback} callback Optional. + * @return {module:client.Promise} Resolves with an object containing the limits. + */ +MatrixClient.prototype.getMediaLimits = function(callback) { + return return this._http.requestWithPrefix( + callback, "GET", "/limits", undefined, undefined, httpApi.PREFIX_MEDIA_R0, + ) +}; + // Room ops // ======== From 9596087959ee941c53f2f36c8fdca495ce39d602 Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Thu, 3 May 2018 17:31:04 +0100 Subject: [PATCH 2/4] Remove extra return --- src/client.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client.js b/src/client.js index 4af13ba44..5ca65d5b5 100644 --- a/src/client.js +++ b/src/client.js @@ -736,9 +736,9 @@ MatrixClient.prototype.getGroups = function() { * @return {module:client.Promise} Resolves with an object containing the limits. */ MatrixClient.prototype.getMediaLimits = function(callback) { - return return this._http.requestWithPrefix( + return this._http.requestWithPrefix( callback, "GET", "/limits", undefined, undefined, httpApi.PREFIX_MEDIA_R0, - ) + ); }; // Room ops From 8dd425f8ff0b67ce0dbca326d2a66eac3637be2d Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Wed, 20 Jun 2018 17:24:45 +0100 Subject: [PATCH 3/4] Media/limits => /config --- src/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client.js b/src/client.js index 5ca65d5b5..25e8314f3 100644 --- a/src/client.js +++ b/src/client.js @@ -737,7 +737,7 @@ MatrixClient.prototype.getGroups = function() { */ MatrixClient.prototype.getMediaLimits = function(callback) { return this._http.requestWithPrefix( - callback, "GET", "/limits", undefined, undefined, httpApi.PREFIX_MEDIA_R0, + callback, "GET", "/config", undefined, undefined, httpApi.PREFIX_MEDIA_R0, ); }; From fde00b1c627e174ee7dbb76efc06bec1a46f52d6 Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Sat, 23 Jun 2018 12:57:29 +0100 Subject: [PATCH 4/4] getMediaLimits -> getMediaConfig --- src/client.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/client.js b/src/client.js index 25e8314f3..a684c5e01 100644 --- a/src/client.js +++ b/src/client.js @@ -728,14 +728,11 @@ MatrixClient.prototype.getGroups = function() { }; /** - * Get the room for the given room ID. - * This function will return a valid room for any room for which a Room event - * has been emitted. Note in particular that other events, eg. RoomState.members - * will be emitted for a room before this function will return the given room. + * Get the config for the media repository. * @param {module:client.callback} callback Optional. - * @return {module:client.Promise} Resolves with an object containing the limits. + * @return {module:client.Promise} Resolves with an object containing the config. */ -MatrixClient.prototype.getMediaLimits = function(callback) { +MatrixClient.prototype.getMediaConfig = function(callback) { return this._http.requestWithPrefix( callback, "GET", "/config", undefined, undefined, httpApi.PREFIX_MEDIA_R0, );