You've already forked matrix-js-sdk
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:
@@ -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
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user