home/recents: show the last message of each message

This commit is contained in:
Emmanuel ROHEE 2014-08-27 14:31:20 +02:00
parent 6691ca6f8d
commit b1352f97ac
3 changed files with 102 additions and 8 deletions

View file

@ -86,7 +86,9 @@ angular.module('HomeController', ['matrixService', 'mFileInput', 'mFileUpload',
$scope.rooms[data[i].room_id] = data[i];
// Create a shortcut for the last message of this room
$scope.rooms[data[i].room_id].lastMsg = data[i].messages.chunk[0];
if (data[i].messages && data[i].messages.chunk && data[i].messages.chunk[0]) {
$scope.rooms[data[i].room_id].lastMsg = data[i].messages.chunk[0];
}
}
var presence = response.data.presence;