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