Reverted patches done for SYWEB-40

This commit is contained in:
Emmanuel ROHEE 2014-09-18 15:19:35 +02:00
parent 704e7e9f44
commit 0db0528e8e
2 changed files with 6 additions and 12 deletions

View file

@ -19,14 +19,13 @@
angular.module('RecentsController')
.filter('orderRecents', ["matrixService", "eventHandlerService", function(matrixService, eventHandlerService) {
return function(rooms) {
var user_id = matrixService.config().user_id;
// Transform the dict into an array
// The key, room_id, is already in value objects
var filtered = [];
angular.forEach(rooms, function(room, room_id) {
// Show the room only if the user has joined it or has been invited
// (ie, do not show it if he has been banned)
var member = eventHandlerService.getMember(room_id, user_id);
@ -35,8 +34,9 @@ angular.module('RecentsController')
// Count users here
// TODO: Compute it directly in eventHandlerService
room.numUsersInRoom = eventHandlerService.getUsersCountInRoom(room_id);
filtered.push(room);
}
filtered.push(room);
});
// And time sort them
@ -60,4 +60,4 @@ angular.module('RecentsController')
});
return filtered;
};
}]);
}]);