1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-09-03 08:42:03 +03:00

Merge remote-tracking branch 'origin/develop' into notif_sync

This commit is contained in:
David Baker
2015-12-22 14:47:39 +00:00
2 changed files with 7 additions and 2 deletions

View File

@@ -2098,14 +2098,19 @@ MatrixClient.prototype.searchMessageText = function(opts, callback) {
/** /**
* Perform a server-side search. * Perform a server-side search.
* @param {Object} opts * @param {Object} opts
* @param {string} opts.next_batch the batch token to pass in the query string
* @param {Object} opts.body the JSON object to pass to the request body. * @param {Object} opts.body the JSON object to pass to the request body.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {module:client.Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.search = function(opts, callback) { MatrixClient.prototype.search = function(opts, callback) {
var queryparams = {};
if (opts.next_batch) {
queryparams.next_batch = opts.next_batch;
}
return this._http.authedRequest( return this._http.authedRequest(
callback, "POST", "/search", undefined, opts.body callback, "POST", "/search", queryparams, opts.body
); );
}; };

View File

@@ -19,7 +19,7 @@ var Filter = require("./filter");
// beyond that and wedge forever, so we need to track how long we are willing // beyond that and wedge forever, so we need to track how long we are willing
// to keep open the connection. This constant is *ADDED* to the timeout= value // to keep open the connection. This constant is *ADDED* to the timeout= value
// to determine the max time we're willing to wait. // to determine the max time we're willing to wait.
var BUFFER_PERIOD_MS = 20 * 1000; var BUFFER_PERIOD_MS = 80 * 1000;
function getFilterName(userId, suffix) { function getFilterName(userId, suffix) {
// scope this on the user ID because people may login on many accounts // scope this on the user ID because people may login on many accounts