1 // Wraps a function so that its 'this' is always 'context' when called |
1 // Wraps a function so that its 'this' is always 'context' when called |
2 var recontext = function (context, f) { return function () { return f.apply(context, arguments); }; }; |
2 var recontext = function (context, f) { return function () { return f.apply(context, arguments); }; }; |
|
3 |
|
4 // Returns a child element given a tag name and xmlns |
|
5 function get_child(stanza, name, xmlns) |
|
6 { |
|
7 var children = stanza.getElementsByTagName(name); |
|
8 for(var i=0;i<=children.length;i++) |
|
9 { |
|
10 if(children[i].getAttribute("xmlns") == xmlns || !xmlns) |
|
11 return children[i]; |
|
12 } |
|
13 return null; |
|
14 } |
|
15 |
|
16 |
3 |
17 |
4 var MUC = function (conn, callbacks) |
18 var MUC = function (conn, callbacks) |
5 { |
19 { |
6 /* Set our properties */ |
20 /* Set our properties */ |
7 this.conn = conn; |
21 this.conn = conn; |