Create contact on incoming call if needed

This commit is contained in:
Lance Stout 2013-10-16 00:04:33 -07:00
parent 5ccdc6361b
commit 1cb062631e
1 changed files with 11 additions and 0 deletions

View File

@ -338,6 +338,12 @@ module.exports = function (client, app) {
client.on('jingle:incoming', function (session) {
var contact = me.getContact(session.peer);
if (!contact) {
contact = new Contact({jid: client.JID(session.peer).bare});
contact.resources.add({id: session.peer});
me.contacts.add(contact);
}
var call = new Call({
contact: contact,
state: 'incoming',
@ -381,6 +387,11 @@ module.exports = function (client, app) {
client.on('jingle:remotestream:added', function (session) {
var contact = me.getContact(session.peer);
if (!contact) {
contact = new Contact({jid: client.JID(session.peer).bare});
contact.resources.add({id: session.peer});
me.contacts.add(contact);
}
contact.stream = session.stream;
});