Commit 194e9688 authored by JC Brand's avatar JC Brand

Rename to avoid name clash with jarnxmpp js.

parent c9cf028c
...@@ -1096,13 +1096,15 @@ ...@@ -1096,13 +1096,15 @@
return rank; return rank;
}, },
rosterSuggestedItem: function (msg) { subscribeToSuggestedItems: function (msg) {
alert('hello');
$(msg).find('item').each(function () { $(msg).find('item').each(function () {
var jid = $(this).attr('jid'); var jid = $(this).attr('jid'),
var action = $(this).attr('action'); action = $(this).attr('action'),
fullname = $(this).attr('name');
if (action === 'add') { if (action === 'add') {
xmppchat.connection.send($pres({to: jid, type: 'subscribe'})); xmppchat.connection.roster.add(jid, fullname, [], function (iq) {
xmppchat.connection.roster.subscribe(jid);
});
} }
}); });
return true; return true;
...@@ -1515,7 +1517,7 @@ ...@@ -1515,7 +1517,7 @@
this.rosterview = Backbone.View.extend(this.RosterView(this.roster, _, $, console)); this.rosterview = Backbone.View.extend(this.RosterView(this.roster, _, $, console));
this.connection.addHandler( this.connection.addHandler(
$.proxy(this.roster.rosterSuggestedItem, this.roster), $.proxy(this.roster.subscribeToSuggestedItems, this.roster),
'http://jabber.org/protocol/rosterx', 'message', null); 'http://jabber.org/protocol/rosterx', 'message', null);
this.connection.addHandler( this.connection.addHandler(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment