mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 19:15:04 -04:00
Determine and send user presence state
This commit is contained in:
parent
b07bc9bdbd
commit
c21fcb3373
4 changed files with 140 additions and 5 deletions
|
@ -20,9 +20,9 @@ limitations under the License.
|
|||
|
||||
'use strict';
|
||||
|
||||
angular.module('MatrixWebClientController', ['matrixService'])
|
||||
.controller('MatrixWebClientController', ['$scope', '$location', '$rootScope', 'matrixService', 'eventStreamService',
|
||||
function($scope, $location, $rootScope, matrixService, eventStreamService) {
|
||||
angular.module('MatrixWebClientController', ['matrixService', 'mPresence', 'eventStreamService'])
|
||||
.controller('MatrixWebClientController', ['$scope', '$location', '$rootScope', 'matrixService', 'mPresence', 'eventStreamService',
|
||||
function($scope, $location, $rootScope, matrixService, mPresence, eventStreamService) {
|
||||
|
||||
// Check current URL to avoid to display the logout button on the login page
|
||||
$scope.location = $location.path();
|
||||
|
@ -34,6 +34,7 @@ angular.module('MatrixWebClientController', ['matrixService'])
|
|||
|
||||
if (matrixService.isUserLoggedIn()) {
|
||||
// eventStreamService.resume();
|
||||
mPresence.start();
|
||||
}
|
||||
|
||||
$scope.go = function(url) {
|
||||
|
@ -42,9 +43,13 @@ angular.module('MatrixWebClientController', ['matrixService'])
|
|||
|
||||
// Logs the user out
|
||||
$scope.logout = function() {
|
||||
|
||||
// kill the event stream
|
||||
eventStreamService.stop();
|
||||
|
||||
|
||||
// Do not update presence anymore
|
||||
mPresence.stop();
|
||||
|
||||
// Clean permanent data
|
||||
matrixService.setConfig({});
|
||||
matrixService.saveConfig();
|
||||
|
@ -67,7 +72,6 @@ angular.module('MatrixWebClientController', ['matrixService'])
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
}]);
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue