|
|
|
@ -153,6 +153,7 @@ Messaging.getRecentChats = function (callerUid, uid, start, stop, callback) {
|
|
|
|
|
},
|
|
|
|
|
function (results, next) {
|
|
|
|
|
results.roomData.forEach(function (room, index) {
|
|
|
|
|
if (room) {
|
|
|
|
|
room.users = results.users[index];
|
|
|
|
|
room.groupChat = room.hasOwnProperty('groupChat') ? room.groupChat : room.users.length > 2;
|
|
|
|
|
room.unread = results.unread[index];
|
|
|
|
@ -169,8 +170,11 @@ Messaging.getRecentChats = function (callerUid, uid, start, stop, callback) {
|
|
|
|
|
room.lastUser = room.users[0];
|
|
|
|
|
|
|
|
|
|
room.usernames = Messaging.generateUsernames(room.users, uid);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
results.roomData = results.roomData.filter(Boolean);
|
|
|
|
|
|
|
|
|
|
next(null, { rooms: results.roomData, nextStart: stop + 1 });
|
|
|
|
|
},
|
|
|
|
|
function (ref, next) {
|
|
|
|
|