diff options
author | Kegan Dougal <kegan@matrix.org> | 2014-08-15 14:06:48 +0100 |
---|---|---|
committer | Kegan Dougal <kegan@matrix.org> | 2014-08-15 14:06:56 +0100 |
commit | 5ac87292c4810d816f16b1d2dd6a0dac643812e5 (patch) | |
tree | c858636626c9cd17407a7d4e103a8c487cd6f9c6 /webclient/room/room-controller.js | |
parent | Event streaming now happens on an app level, rather than a per-room level. Ma... (diff) | |
download | synapse-5ac87292c4810d816f16b1d2dd6a0dac643812e5.tar.xz |
Remove old polling stuff from RoomController. Added service comments. Do not start the event stream on startup unless you have credentials.
Diffstat (limited to 'webclient/room/room-controller.js')
-rw-r--r-- | webclient/room/room-controller.js | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index 49c73ff4bb..0d54c6f4d8 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -29,7 +29,6 @@ angular.module('RoomController', []) stream_failure: undefined // the response when the stream fails }; $scope.members = {}; - $scope.stopPoll = false; $scope.imageURLToSend = ""; $scope.userIDToInvite = ""; @@ -71,40 +70,6 @@ angular.module('RoomController', []) ) }; - var shortPoll = function() { - eventStreamService.resume().then( - function(response) { - $scope.state.stream_failure = undefined; - console.log("Got response from "+$scope.state.events_from+" to "+response.data.end); - $scope.state.events_from = response.data.end; - $scope.feedback = ""; - - eventHandlerService.handleEvents(response.data.chunk, true); - - if ($scope.stopPoll) { - console.log("Stopping polling."); - } - else { - $timeout(shortPoll, 0); - } - }, - function(error) { - $scope.state.stream_failure = error; - - if (error.status == 403) { - $scope.stopPoll = true; - } - - if ($scope.stopPoll) { - console.log("Stopping polling."); - } - else { - $timeout(shortPoll, 5000); - } - } - ); - }; - var updateMemberList = function(chunk) { var isNewMember = !(chunk.target_user_id in $scope.members); if (isNewMember) { @@ -260,9 +225,4 @@ angular.module('RoomController', []) $scope.loadMoreHistory = function() { paginate(MESSAGES_PER_PAGINATION); }; - - $scope.$on('$destroy', function(e) { - console.log("onDestroyed: Stopping poll."); - $scope.stopPoll = true; - }); }]); |