|
|
|
@ -205,6 +205,7 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro |
|
|
|
} |
|
|
|
} |
|
|
|
subscope = controller.rooms[id] = scope.$new(); |
|
|
|
subscope = controller.rooms[id] = scope.$new(); |
|
|
|
translation.inject(subscope); |
|
|
|
translation.inject(subscope); |
|
|
|
|
|
|
|
subscope.contact = {}; |
|
|
|
subscope.id = id; |
|
|
|
subscope.id = id; |
|
|
|
subscope.isgroupchat = !!settings.group; |
|
|
|
subscope.isgroupchat = !!settings.group; |
|
|
|
subscope.index = index; |
|
|
|
subscope.index = index; |
|
|
|
@ -217,9 +218,15 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro |
|
|
|
subscope.p2pstate = false; |
|
|
|
subscope.p2pstate = false; |
|
|
|
subscope.active = false; |
|
|
|
subscope.active = false; |
|
|
|
subscope.pending = 0; |
|
|
|
subscope.pending = 0; |
|
|
|
subscope.isUser = !!(buddy && buddy.session && buddy.session.Userid); |
|
|
|
var handleContactFunctionality = function() { |
|
|
|
subscope.isContact = !!(buddy && buddy.contact); |
|
|
|
var buddyId = buddy && buddy.session && buddy.session.Userid; |
|
|
|
subscope.canAddContact = !subscope.isgroupchat && subscope.isUser; |
|
|
|
var myId = appData.get().userid; |
|
|
|
|
|
|
|
var isAnotherUser = buddyId && myId !== buddyId; |
|
|
|
|
|
|
|
subscope.contact.isContact = !!(buddy && buddy.contact); |
|
|
|
|
|
|
|
subscope.contact.disableContact = !myId || !isAnotherUser; |
|
|
|
|
|
|
|
subscope.contact.showContact = !subscope.isgroupchat && buddyId; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
handleContactFunctionality(); |
|
|
|
if (!subscope.isgroupchat) { |
|
|
|
if (!subscope.isgroupchat) { |
|
|
|
buddyData.push(id); |
|
|
|
buddyData.push(id); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -349,7 +356,7 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro |
|
|
|
if (userid !== data.Userid) { |
|
|
|
if (userid !== data.Userid) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
subscope.isContact = event.type === "contactadded"; |
|
|
|
subscope.contact.isContact = event.type === "contactadded"; |
|
|
|
safeApply(subscope); |
|
|
|
safeApply(subscope); |
|
|
|
}; |
|
|
|
}; |
|
|
|
contacts.e.on("contactadded", subscope.updateContactStatus); |
|
|
|
contacts.e.on("contactadded", subscope.updateContactStatus); |
|
|
|
|