You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-08-09 10:22:46 +03:00
searchMessageText: avoid setting keys=undefined
This doesn't make any difference to the JSON, but it upsets `expect`.
This commit is contained in:
@@ -2286,13 +2286,18 @@ MatrixClient.prototype.setRoomMutePushRule = function(scope, roomId, mute) {
|
||||
* @return {module:http-api.MatrixError} Rejects: with an error response.
|
||||
*/
|
||||
MatrixClient.prototype.searchMessageText = function(opts, callback) {
|
||||
const roomEvents = {
|
||||
search_term: opts.query,
|
||||
};
|
||||
|
||||
if ('keys' in opts) {
|
||||
roomEvents.keys = opts.keys;
|
||||
}
|
||||
|
||||
return this.search({
|
||||
body: {
|
||||
search_categories: {
|
||||
room_events: {
|
||||
keys: opts.keys,
|
||||
search_term: opts.query,
|
||||
},
|
||||
room_events: roomEvents,
|
||||
},
|
||||
},
|
||||
}, callback);
|
||||
|
Reference in New Issue
Block a user