From c67cac134fd6e334254a3bef3e54419a32f3fd56 Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Wed, 27 Aug 2014 15:07:51 +0200 Subject: Moved assignRoomAliases into a central piece: matrixService for now --- webclient/components/matrix/matrix-service.js | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/webclient/components/matrix/matrix-service.js b/webclient/components/matrix/matrix-service.js index c63e55bb07..2feddac5d8 100644 --- a/webclient/components/matrix/matrix-service.js +++ b/webclient/components/matrix/matrix-service.js @@ -415,6 +415,40 @@ angular.module('matrixService', []) config.version = configVersion; localStorage.setItem("config", JSON.stringify(config)); }, + + + /****** Room aliases management ******/ + + /** + * Enhance data returned by rooms() and publicRooms() by adding room_alias + * & room_display_name which are computed from data already retrieved from the server. + * @param {Array} data the response of rooms() and publicRooms() + * @returns {Array} the same array with enriched objects + */ + assignRoomAliases: function(data) { + for (var i=0; i