@@ -193,9 +193,9 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
193193 var options = $ . extend ( { } , opts ) ;
194194 var subscope = controller . rooms [ id ] ;
195195 var index = controller . visibleRooms . length ;
196- var buddy = buddyData . lookup ( id ) ;
197196 if ( ! subscope ) {
198197 console . log ( "Create new chatroom" , [ id ] ) ;
198+ var buddy = buddyData . lookup ( id ) ;
199199 if ( settings . group ) {
200200 controller . visibleRooms . unshift ( id ) ;
201201 } else {
@@ -215,9 +215,9 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
215215 subscope . p2pstate = false ;
216216 subscope . active = false ;
217217 subscope . pending = 0 ;
218- subscope . isuser = ! ! ( buddy && buddy . session && buddy . session . Userid ) ;
219- subscope . iscontact = ! ! ( buddy && buddy . contact ) ;
220- subscope . canAddContact = ! subscope . isgroupchat && subscope . isuser ;
218+ subscope . isUser = ! ! ( buddy && buddy . session && buddy . session . Userid ) ;
219+ subscope . isContact = ! ! ( buddy && buddy . contact ) ;
220+ subscope . canAddContact = ! subscope . isgroupchat && subscope . isUser ;
221221 if ( ! subscope . isgroupchat ) {
222222 buddyData . push ( id ) ;
223223 }
@@ -341,7 +341,7 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
341341 contacts . remove ( buddy . contact . Userid ) ;
342342 } ;
343343 subscope . updateContactStatus = function ( event , data ) {
344- subscope . iscontact = event . type === "contactadded" ;
344+ subscope . isContact = event . type === "contactadded" ;
345345 } ;
346346 contacts . e . on ( "contactadded" , subscope . updateContactStatus ) ;
347347 contacts . e . on ( "contactremoved" , subscope . updateContactStatus ) ;
0 commit comments