@@ -195,9 +195,9 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
195
195
var options = $ . extend ( { } , opts ) ;
196
196
var subscope = controller . rooms [ id ] ;
197
197
var index = controller . visibleRooms . length ;
198
- var buddy = buddyData . lookup ( id ) ;
199
198
if ( ! subscope ) {
200
199
console . log ( "Create new chatroom" , [ id ] ) ;
200
+ var buddy = buddyData . lookup ( id ) ;
201
201
if ( settings . group ) {
202
202
controller . visibleRooms . unshift ( id ) ;
203
203
} else {
@@ -217,9 +217,9 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
217
217
subscope . p2pstate = false ;
218
218
subscope . active = false ;
219
219
subscope . pending = 0 ;
220
- subscope . isuser = ! ! ( buddy && buddy . session && buddy . session . Userid ) ;
221
- subscope . iscontact = ! ! ( buddy && buddy . contact ) ;
222
- subscope . canAddContact = ! subscope . isgroupchat && subscope . isuser ;
220
+ subscope . isUser = ! ! ( buddy && buddy . session && buddy . session . Userid ) ;
221
+ subscope . isContact = ! ! ( buddy && buddy . contact ) ;
222
+ subscope . canAddContact = ! subscope . isgroupchat && subscope . isUser ;
223
223
if ( ! subscope . isgroupchat ) {
224
224
buddyData . push ( id ) ;
225
225
}
@@ -345,7 +345,7 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
345
345
contacts . remove ( buddy . contact . Userid ) ;
346
346
} ;
347
347
subscope . updateContactStatus = function ( event , data ) {
348
- subscope . iscontact = event . type === "contactadded" ;
348
+ subscope . isContact = event . type === "contactadded" ;
349
349
} ;
350
350
contacts . e . on ( "contactadded" , subscope . updateContactStatus ) ;
351
351
contacts . e . on ( "contactremoved" , subscope . updateContactStatus ) ;
0 commit comments