mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-26 10:59:22 -05:00
The away state is unavailable not offline
This commit is contained in:
parent
e76cd252fe
commit
7c4b47652e
@ -23,9 +23,9 @@
|
|||||||
angular.module('mPresence', [])
|
angular.module('mPresence', [])
|
||||||
.service('mPresence', ['$timeout', 'matrixService', function ($timeout, matrixService) {
|
.service('mPresence', ['$timeout', 'matrixService', function ($timeout, matrixService) {
|
||||||
|
|
||||||
// Time in ms after that a user is considered as offline/away
|
// Time in ms after that a user is considered as unavailable/away
|
||||||
var OFFLINE_TIME = 5 * 60000; // 5 mins
|
var UNAVAILABLE_TIME = 5 * 60000; // 5 mins
|
||||||
|
|
||||||
// The current presence state
|
// The current presence state
|
||||||
var state = undefined;
|
var state = undefined;
|
||||||
|
|
||||||
@ -88,11 +88,11 @@ angular.module('mPresence', [])
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback called when the user made no action on the page for OFFLINE_TIME ms.
|
* Callback called when the user made no action on the page for UNAVAILABLE_TIME ms.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
function onOfflineTimerFire() {
|
function onUnvailableTimerFire() {
|
||||||
self.setState(matrixService.presence.offline);
|
self.setState(matrixService.presence.unavailable);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -105,7 +105,7 @@ angular.module('mPresence', [])
|
|||||||
|
|
||||||
// Re-arm the timer
|
// Re-arm the timer
|
||||||
$timeout.cancel(timer);
|
$timeout.cancel(timer);
|
||||||
timer = $timeout(onOfflineTimerFire, OFFLINE_TIME);
|
timer = $timeout(onUnvailableTimerFire, UNAVAILABLE_TIME);
|
||||||
}
|
}
|
||||||
|
|
||||||
}]);
|
}]);
|
||||||
|
Loading…
Reference in New Issue
Block a user