1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Merge pull request #557 from turt2live/travis/presence

Support set_presence=offline for syncing
This commit is contained in:
Matthew Hodgson
2017-11-14 23:41:37 +00:00
committed by GitHub
2 changed files with 9 additions and 0 deletions

View File

@@ -2983,6 +2983,9 @@ MatrixClient.prototype.getTurnServers = function() {
*
* @param {Filter=} opts.filter The filter to apply to /sync calls. This will override
* the opts.initialSyncLimit, which would normally result in a timeline limit filter.
*
* @param {Boolean=} opts.disablePresence True to perform syncing without automatically
* updating presence.
*/
MatrixClient.prototype.startClient = function(opts) {
if (this.clientRunning) {

View File

@@ -71,6 +71,8 @@ function debuglog(...params) {
* SAFELY remove events from this room. It may not be safe to remove events if
* there are other references to the timelines for this room.
* Default: returns false.
* @param {Boolean=} opts.disablePresence True to perform syncing without automatically
* updating presence.
*/
function SyncApi(client, opts) {
this.client = client;
@@ -545,6 +547,10 @@ SyncApi.prototype._sync = async function(syncOptions) {
timeout: pollTimeout,
};
if (this.opts.disablePresence) {
qps.set_presence = "offline";
}
if (syncToken) {
qps.since = syncToken;
} else {