diff --git a/static/js/directives/chat.js b/static/js/directives/chat.js index 45bd4009..d2505982 100644 --- a/static/js/directives/chat.js +++ b/static/js/directives/chat.js @@ -195,9 +195,9 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro var options = $.extend({}, opts); var subscope = controller.rooms[id]; var index = controller.visibleRooms.length; - var buddy = buddyData.lookup(id); if (!subscope) { console.log("Create new chatroom", [id]); + var buddy = buddyData.lookup(id); if (settings.group) { controller.visibleRooms.unshift(id); } else { @@ -217,9 +217,9 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro subscope.p2pstate = false; subscope.active = false; subscope.pending = 0; - subscope.isuser = !!(buddy && buddy.session && buddy.session.Userid); - subscope.iscontact = !!(buddy && buddy.contact); - subscope.canAddContact = !subscope.isgroupchat && subscope.isuser; + subscope.isUser = !!(buddy && buddy.session && buddy.session.Userid); + subscope.isContact = !!(buddy && buddy.contact); + subscope.canAddContact = !subscope.isgroupchat && subscope.isUser; if (!subscope.isgroupchat) { buddyData.push(id); } @@ -345,7 +345,7 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro contacts.remove(buddy.contact.Userid); }; subscope.updateContactStatus = function(event, data) { - subscope.iscontact = event.type === "contactadded"; + subscope.isContact = event.type === "contactadded"; }; contacts.e.on("contactadded", subscope.updateContactStatus); contacts.e.on("contactremoved", subscope.updateContactStatus); diff --git a/static/partials/chatroom.html b/static/partials/chatroom.html index e8089889..d6c3819b 100644 --- a/static/partials/chatroom.html +++ b/static/partials/chatroom.html @@ -5,8 +5,8 @@ - - + +