diff options
author | Matthew Hodgson <matthew@matrix.org> | 2014-08-16 13:22:47 +0100 |
---|---|---|
committer | Matthew Hodgson <matthew@matrix.org> | 2014-08-16 13:23:16 +0100 |
commit | ce4ca473cbafce0fc71a2b4e69e35caa8f251595 (patch) | |
tree | fa0e014e00fc0e9192fd343ce42feb2657b06d7b /webclient/app.js | |
parent | don't hammer a new hit for every displayname and avatar_url when we already h... (diff) | |
download | synapse-ce4ca473cbafce0fc71a2b4e69e35caa8f251595.tar.xz |
order the members list by most recently active
Diffstat (limited to 'webclient/app.js')
-rw-r--r-- | webclient/app.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/webclient/app.js b/webclient/app.js index 3f4c5f30f8..9cdf926425 100644 --- a/webclient/app.js +++ b/webclient/app.js @@ -114,7 +114,20 @@ matrixWebClient return d + "d " + h + "h"; } }) - .filter('to_trusted', ['$sce', function($sce){ + .filter('orderMembersList', function($sce) { + return function(members) { + var filtered = []; + angular.forEach(members, function(value, key) { + value["id"] = key; + filtered.push( value ); + }); + filtered.sort(function (a, b) { + return ((a["mtime_age"] || 10e10)> (b["mtime_age"] || 10e10) ? 1 : -1); + }); + return filtered; + }; + }) + .filter('unsafe', ['$sce', function($sce) { return function(text) { return $sce.trustAsHtml(text); }; |