Skip to content

Commit 5e9028c

Browse files
committed
made register plugin compatible with both disco plugins
1 parent c49cefb commit 5e9028c

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

register/strophe.register.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,12 @@ Strophe.addConnectionPlugin('register', {
4141
Strophe.Status.CONFLICT = i + 4;
4242
Strophe.Status.NOTACCEPTABLE = i + 5;
4343

44-
if (conn.disco)
44+
if (conn.disco) {
45+
if(conn.disco.addFeature)
4546
conn.disco.addFeature(Strophe.NS.REGISTER);
47+
if(conn.disco.addNode)
48+
conn.disco.addNode(Strophe.NS.REGISTER, {items:[]});
49+
}
4650

4751
// hooking strophe's connection.reset
4852
var self = this, reset = conn.reset.bind(conn);
@@ -78,7 +82,7 @@ Strophe.addConnectionPlugin('register', {
7882
// remember that we already processed stream:features
7983
self.processed_features = true;
8084
delete self._registering;
81-
};
85+
}
8286
}
8387
};
8488

@@ -206,7 +210,7 @@ Strophe.addConnectionPlugin('register', {
206210
null, "iq", null, null);
207211
conn.send($iq({type: "get"}).c("query",
208212
{xmlns: Strophe.NS.REGISTER}).tree());
209-
213+
210214
return true;
211215
},
212216

0 commit comments

Comments
 (0)