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