|
@@ -71780,6 +71780,7 @@ strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('DELAY', 'urn:xm
|
|
|
strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('FORWARD', 'urn:xmpp:forward:0');
|
|
|
strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('HINTS', 'urn:xmpp:hints');
|
|
|
strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('HTTPUPLOAD', 'urn:xmpp:http:upload:0');
|
|
|
+strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('IDLE', 'urn:xmpp:idle:1');
|
|
|
strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('MAM', 'urn:xmpp:mam:2');
|
|
|
strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('NICK', 'http://jabber.org/protocol/nick');
|
|
|
strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('OMEMO', "eu.siacs.conversations.axolotl");
|
|
@@ -71931,6 +71932,8 @@ _converse.default_settings = {
|
|
|
expose_rid_and_sid: false,
|
|
|
geouri_regex: /https:\/\/www.openstreetmap.org\/.*#map=[0-9]+\/([\-0-9.]+)\/([\-0-9.]+)\S*/g,
|
|
|
geouri_replacement: 'https://www.openstreetmap.org/?mlat=$1&mlon=$2#map=18/$1/$2',
|
|
|
+ idle_presence_timeout: 300,
|
|
|
+ // Seconds after which an idle presence is sent
|
|
|
jid: undefined,
|
|
|
keepalive: true,
|
|
|
locales_url: 'locale/{{{locale}}}/LC_MESSAGES/converse.json',
|
|
@@ -72166,6 +72169,12 @@ _converse.initialize = function (settings, callback) {
|
|
|
_converse.sendCSI(_converse.ACTIVE);
|
|
|
}
|
|
|
|
|
|
+ if (_converse.idle) {
|
|
|
+ _converse.idle = false;
|
|
|
+
|
|
|
+ _converse.xmppstatus.sendPresence();
|
|
|
+ }
|
|
|
+
|
|
|
if (_converse.auto_changed_status === true) {
|
|
|
_converse.auto_changed_status = false; // XXX: we should really remember the original state here, and
|
|
|
// then set it back to that...
|
|
@@ -72192,6 +72201,12 @@ _converse.initialize = function (settings, callback) {
|
|
|
_converse.sendCSI(_converse.INACTIVE);
|
|
|
}
|
|
|
|
|
|
+ if (_converse.idle_presence_timeout > 0 && _converse.idle_seconds > _converse.idle_presence_timeout && !_converse.idle) {
|
|
|
+ _converse.idle = true;
|
|
|
+
|
|
|
+ _converse.xmppstatus.sendPresence();
|
|
|
+ }
|
|
|
+
|
|
|
if (_converse.auto_away > 0 && _converse.idle_seconds > _converse.auto_away && stat !== 'away' && stat !== 'xa' && stat !== 'dnd') {
|
|
|
_converse.auto_changed_status = true;
|
|
|
|
|
@@ -72207,7 +72222,7 @@ _converse.initialize = function (settings, callback) {
|
|
|
/* Set an interval of one second and register a handler for it.
|
|
|
* Required for the auto_away, auto_xa and csi_waiting_time features.
|
|
|
*/
|
|
|
- if (_converse.auto_away < 1 && _converse.auto_xa < 1 && _converse.csi_waiting_time < 1) {
|
|
|
+ if (_converse.auto_away < 1 && _converse.auto_xa < 1 && _converse.csi_waiting_time < 1 && _converse.idle_presence_timeout < 1) {
|
|
|
// Waiting time of less then one second means features aren't used.
|
|
|
return;
|
|
|
}
|
|
@@ -72707,7 +72722,17 @@ _converse.initialize = function (settings, callback) {
|
|
|
presence.c('status').t(status_message).up();
|
|
|
}
|
|
|
|
|
|
- presence.c('priority').t(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isNaN(Number(_converse.priority)) ? 0 : _converse.priority);
|
|
|
+ presence.c('priority').t(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isNaN(Number(_converse.priority)) ? 0 : _converse.priority).up();
|
|
|
+
|
|
|
+ if (_converse.idle) {
|
|
|
+ const idle_since = new Date();
|
|
|
+ idle_since.setSeconds(idle_since.getSeconds() - _converse.idle_seconds);
|
|
|
+ presence.c('idle', {
|
|
|
+ xmlns: strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].NS.IDLE,
|
|
|
+ since: idle_since.toISOString()
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
return presence;
|
|
|
},
|
|
|
|
|
@@ -73015,6 +73040,12 @@ _converse.initialize = function (settings, callback) {
|
|
|
if (!Backbone.history.started) {
|
|
|
Backbone.history.start();
|
|
|
}
|
|
|
+
|
|
|
+ if (_converse.idle_presence_timeout > 0) {
|
|
|
+ _converse.on('addClientFeatures', () => {
|
|
|
+ _converse.api.disco.own.features.add(strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].NS.IDLE);
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (!_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isUndefined(_converse.connection) && _converse.connection.service === 'jasmine tests') {
|