adding in 'allowed' to template, re: #2321

v1.18.x
Julian Lam 10 years ago
parent b12e3562d5
commit 61aaff025b

@ -553,7 +553,8 @@ accountsController.getChats = function(req, res, next) {
function(toUid, next) {
async.parallel({
toUser: async.apply(user.getUserFields, toUid, ['uid', 'username']),
messages: async.apply(messaging.getMessages, req.user.uid, toUid, 'recent', false)
messages: async.apply(messaging.getMessages, req.user.uid, toUid, 'recent', false),
allowed: async.apply(messaging.canMessage, req.user.uid, toUid)
}, next);
}
], function(err, data) {
@ -566,7 +567,8 @@ accountsController.getChats = function(req, res, next) {
nextStart: results.recentChats.nextStart,
contacts: results.contacts,
meta: data.toUser,
messages: data.messages
messages: data.messages,
allowed: data.allowed
});
});
});

Loading…
Cancel
Save