socket.on('response', function(data) { if (data.accept) { xmpp.acceptSubscription(data.contact); } socket.emit("add-contact", { name: data.contact }); });
xmpp.on('subscribe', function(from) { if (from && config.acceptedUsers.indexOf(from) >= 0) { xmpp.acceptSubscription(from); } });
xmpp.on('subscribe', function(from) { xmpp.acceptSubscription(from); });
xmpp.on('subscribe', function(from) { xmpp.acceptSubscription(from); console.log(toUTCDateTimeString(new Date()) + ':accept subscribe from:' + from); controller.trigger('subscribe', [bot, from]); });