Skip to content

Commit

Permalink
made register plugin compatible with both disco plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Gordin committed Sep 2, 2014
1 parent c49cefb commit 5e9028c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions register/strophe.register.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ Strophe.addConnectionPlugin('register', {
Strophe.Status.CONFLICT = i + 4;
Strophe.Status.NOTACCEPTABLE = i + 5;

if (conn.disco)
if (conn.disco) {
if(conn.disco.addFeature)
conn.disco.addFeature(Strophe.NS.REGISTER);
if(conn.disco.addNode)
conn.disco.addNode(Strophe.NS.REGISTER, {items:[]});
}

// hooking strophe's connection.reset
var self = this, reset = conn.reset.bind(conn);
Expand Down Expand Up @@ -78,7 +82,7 @@ Strophe.addConnectionPlugin('register', {
// remember that we already processed stream:features
self.processed_features = true;
delete self._registering;
};
}
}
};

Expand Down Expand Up @@ -206,7 +210,7 @@ Strophe.addConnectionPlugin('register', {
null, "iq", null, null);
conn.send($iq({type: "get"}).c("query",
{xmlns: Strophe.NS.REGISTER}).tree());

return true;
},

Expand Down

0 comments on commit 5e9028c

Please sign in to comment.