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

@@ -1,10 +1,3 @@
Unreleased Changed:
===================
**BREAKING CHANGES**:
* /publicRooms now uses the new POST API. This is only present
on synapse versions 0.18.0-rc1 and later.
Changes in [0.5.6](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v0.5.6) (2016-08-28) Changes in [0.5.6](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v0.5.6) (2016-08-28)
================================================================================================ ================================================================================================
[Full Changelog](https://github.com/matrix-org/matrix-js-sdk/compare/v0.5.5...v0.5.6) [Full Changelog](https://github.com/matrix-org/matrix-js-sdk/compare/v0.5.5...v0.5.6)

View File

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