1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

Make js-sdk compatible with older synapses

Use GET API if no params given. Revert changelog entry since it now doesn't break older synapses.
This commit is contained in:
David Baker
2016-09-16 23:23:25 +01:00
parent 17ed38ad05
commit 0d51fad805
2 changed files with 7 additions and 10 deletions

View File

@@ -441,9 +441,13 @@ MatrixBaseApis.prototype.publicRooms = function(options, callback) {
delete options.server;
}
return this._http.authedRequest(
callback, "POST", "/publicRooms", query_params, options
);
if (Object.keys(options).length === 0 && Object.keys(query_params).length === 0) {
return this._http.authedRequest(callback, "GET", "/publicRooms");
} else {
return this._http.authedRequest(
callback, "POST", "/publicRooms", query_params, options
);
}
};
/**