From 61aaff025b3d21d9994206e1b21ccdc1e59d9317 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 30 Oct 2014 18:05:24 -0400 Subject: [PATCH] adding in 'allowed' to template, re: #2321 --- src/controllers/accounts.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/controllers/accounts.js b/src/controllers/accounts.js index 867b208989..735aedb55c 100644 --- a/src/controllers/accounts.js +++ b/src/controllers/accounts.js @@ -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 }); }); });