support-chat/js/xmpp_muc.js

Mon, 05 Apr 2010 13:15:59 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Mon, 05 Apr 2010 13:15:59 +0100
changeset 48
12b42931151a
parent 42
src/js/xmpp_muc.js@815816ceb1ad
child 57
42f5669be677
permissions
-rw-r--r--

Rename src/ -> support-chat/

19
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
1 // Wraps a function so that its 'this' is always 'context' when called
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
2 var recontext = function (context, f) { return function () { return f.apply(context, arguments); }; };
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
3
41
d22dee1f3dba xmpp_muc.js: Add get_child() function
Matthew Wild <mwild1@gmail.com>
parents: 36
diff changeset
4 // Returns a child element given a tag name and xmlns
d22dee1f3dba xmpp_muc.js: Add get_child() function
Matthew Wild <mwild1@gmail.com>
parents: 36
diff changeset
5 function get_child(stanza, name, xmlns)
d22dee1f3dba xmpp_muc.js: Add get_child() function
Matthew Wild <mwild1@gmail.com>
parents: 36
diff changeset
6 {
d22dee1f3dba xmpp_muc.js: Add get_child() function
Matthew Wild <mwild1@gmail.com>
parents: 36
diff changeset
7 var children = stanza.getElementsByTagName(name);
d22dee1f3dba xmpp_muc.js: Add get_child() function
Matthew Wild <mwild1@gmail.com>
parents: 36
diff changeset
8 for(var i=0;i<=children.length;i++)
d22dee1f3dba xmpp_muc.js: Add get_child() function
Matthew Wild <mwild1@gmail.com>
parents: 36
diff changeset
9 {
d22dee1f3dba xmpp_muc.js: Add get_child() function
Matthew Wild <mwild1@gmail.com>
parents: 36
diff changeset
10 if(children[i].getAttribute("xmlns") == xmlns || !xmlns)
d22dee1f3dba xmpp_muc.js: Add get_child() function
Matthew Wild <mwild1@gmail.com>
parents: 36
diff changeset
11 return children[i];
d22dee1f3dba xmpp_muc.js: Add get_child() function
Matthew Wild <mwild1@gmail.com>
parents: 36
diff changeset
12 }
d22dee1f3dba xmpp_muc.js: Add get_child() function
Matthew Wild <mwild1@gmail.com>
parents: 36
diff changeset
13 return null;
d22dee1f3dba xmpp_muc.js: Add get_child() function
Matthew Wild <mwild1@gmail.com>
parents: 36
diff changeset
14 }
d22dee1f3dba xmpp_muc.js: Add get_child() function
Matthew Wild <mwild1@gmail.com>
parents: 36
diff changeset
15
d22dee1f3dba xmpp_muc.js: Add get_child() function
Matthew Wild <mwild1@gmail.com>
parents: 36
diff changeset
16
d22dee1f3dba xmpp_muc.js: Add get_child() function
Matthew Wild <mwild1@gmail.com>
parents: 36
diff changeset
17
19
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
18 var MUC = function (conn, callbacks)
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
19 {
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
20 /* Set our properties */
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
21 this.conn = conn;
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
22 this.callbacks = callbacks;
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
23
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
24 this.occupants = {};
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
25
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
26 /* Initialize stanza handlers */
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
27 conn.addHandler(recontext(this, this.handle_join), null, "presence", null, null, null);
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
28 conn.addHandler(recontext(this, this.handle_error), null, "presence", "error", null, null);
25
2651c3a7e621 Add support for handling incoming messages to the MUC library
Matthew Wild <mwild1@gmail.com>
parents: 20
diff changeset
29 conn.addHandler(recontext(this, this.handle_message), null, "message", "groupchat", null, null);
19
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
30
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
31 /* Return newly-created object */
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
32 return this;
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
33 }
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
34
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
35 MUC.prototype =
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
36 {
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
37 /** General methods */
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
38
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
39 join: function (jid, nick, status_text)
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
40 {
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
41 this.jid = jid;
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
42 this.nick = nick;
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
43 var pres = $pres({to: jid+'/'+nick});
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
44 if(status)
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
45 pres.c("status").t(status);
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
46 return this.send_stanza(pres);
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
47 },
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
48
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
49 part: function (status_text)
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
50 {
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
51 var pres = $pres({to: this.jid+'/'+this.nick, type: "unavailable"});
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
52 if(status)
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
53 pres.c("status").t(status);
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
54 return this.send_stanza(pres);
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
55 },
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
56
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
57 send_message: function (message)
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
58 {
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
59 return this.send_stanza($msg({to: this.jid, type: "groupchat"})
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
60 .c("body").t(message||""));
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
61 },
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
62
20
bd1d350ab61c Add to the MUC library support for sending private messages
Matthew Wild <mwild1@gmail.com>
parents: 19
diff changeset
63 send_private_message: function (nick, message)
bd1d350ab61c Add to the MUC library support for sending private messages
Matthew Wild <mwild1@gmail.com>
parents: 19
diff changeset
64 {
bd1d350ab61c Add to the MUC library support for sending private messages
Matthew Wild <mwild1@gmail.com>
parents: 19
diff changeset
65 return this.send_stanza($msg({to: this.jid+"/"+nick, type: "chat"})
bd1d350ab61c Add to the MUC library support for sending private messages
Matthew Wild <mwild1@gmail.com>
parents: 19
diff changeset
66 .c("body").t(message||""));
bd1d350ab61c Add to the MUC library support for sending private messages
Matthew Wild <mwild1@gmail.com>
parents: 19
diff changeset
67 },
bd1d350ab61c Add to the MUC library support for sending private messages
Matthew Wild <mwild1@gmail.com>
parents: 19
diff changeset
68
36
562ff07a3968 Large commit - reorganises directory structure, lots of small fixes
Matthew Wild <mwild1@gmail.com>
parents: 25
diff changeset
69 send_invite: function (jid, message)
562ff07a3968 Large commit - reorganises directory structure, lots of small fixes
Matthew Wild <mwild1@gmail.com>
parents: 25
diff changeset
70 {
562ff07a3968 Large commit - reorganises directory structure, lots of small fixes
Matthew Wild <mwild1@gmail.com>
parents: 25
diff changeset
71 return this.send_stanza($msg({to: jid})
562ff07a3968 Large commit - reorganises directory structure, lots of small fixes
Matthew Wild <mwild1@gmail.com>
parents: 25
diff changeset
72 .c("x", { xmlns: "http://jabber.org/protocol/muc#user" })
562ff07a3968 Large commit - reorganises directory structure, lots of small fixes
Matthew Wild <mwild1@gmail.com>
parents: 25
diff changeset
73 .c("invite", { to: jid })
562ff07a3968 Large commit - reorganises directory structure, lots of small fixes
Matthew Wild <mwild1@gmail.com>
parents: 25
diff changeset
74 .c("reason").t(message||""));
562ff07a3968 Large commit - reorganises directory structure, lots of small fixes
Matthew Wild <mwild1@gmail.com>
parents: 25
diff changeset
75 },
562ff07a3968 Large commit - reorganises directory structure, lots of small fixes
Matthew Wild <mwild1@gmail.com>
parents: 25
diff changeset
76
19
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
77 send_stanza: function (stanza)
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
78 {
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
79 return this.conn.send(stanza.tree());
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
80 },
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
81
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
82 /** Incoming stanza handlers */
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
83
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
84 handle_join: function (stanza)
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
85 {
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
86 var nick = Strophe.getResourceFromJid(stanza.getAttribute("from"));
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
87 if(stanza.getAttribute("type") != "unavailable" && stanza.getAttribute("type") != "error"
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
88 && Strophe.getBareJidFromJid(stanza.getAttribute("from")) == this.jid)
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
89 if(!this.occupants[nick])
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
90 {
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
91 var text = stanza.getElementsByTagName("status")[0];
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
92 if(text) text = Strophe.getText(text);
42
815816ceb1ad xmpp_muc.js: Prepare occupant object with nick, status, role and affiliation
Matthew Wild <mwild1@gmail.com>
parents: 41
diff changeset
93 this.occupants[nick] = { nick: nick, status: text };
815816ceb1ad xmpp_muc.js: Prepare occupant object with nick, status, role and affiliation
Matthew Wild <mwild1@gmail.com>
parents: 41
diff changeset
94 var item = get_child(stanza, "x", "http://jabber.org/protocol/muc#user");
815816ceb1ad xmpp_muc.js: Prepare occupant object with nick, status, role and affiliation
Matthew Wild <mwild1@gmail.com>
parents: 41
diff changeset
95 if(item)
815816ceb1ad xmpp_muc.js: Prepare occupant object with nick, status, role and affiliation
Matthew Wild <mwild1@gmail.com>
parents: 41
diff changeset
96 {
815816ceb1ad xmpp_muc.js: Prepare occupant object with nick, status, role and affiliation
Matthew Wild <mwild1@gmail.com>
parents: 41
diff changeset
97 item = item.getElementsByTagName("item")[0];
815816ceb1ad xmpp_muc.js: Prepare occupant object with nick, status, role and affiliation
Matthew Wild <mwild1@gmail.com>
parents: 41
diff changeset
98 this.occupants[nick].affiliation = item.getAttribute("affiliation");
815816ceb1ad xmpp_muc.js: Prepare occupant object with nick, status, role and affiliation
Matthew Wild <mwild1@gmail.com>
parents: 41
diff changeset
99 this.occupants[nick].role = item.getAttribute("role");
815816ceb1ad xmpp_muc.js: Prepare occupant object with nick, status, role and affiliation
Matthew Wild <mwild1@gmail.com>
parents: 41
diff changeset
100 }
19
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
101 if(this.callbacks.joined)
42
815816ceb1ad xmpp_muc.js: Prepare occupant object with nick, status, role and affiliation
Matthew Wild <mwild1@gmail.com>
parents: 41
diff changeset
102 this.callbacks.joined(stanza, this, this.occupants[nick]);
19
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
103 if(this.status_handler)
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
104 {
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
105 this.status_handler(stanza);
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
106 }
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
107 }
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
108 return true;
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
109 },
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
110
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
111 handle_error: function (stanza)
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
112 {
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
113 if(this.callbacks.error
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
114 && Strophe.getBareJidFromJid(stanza.getAttribute("from")) == this.jid)
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
115 {
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
116 var e = stanza.getElementsByTagName("error");
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
117 if(e.length > 0)
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
118 {
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
119 var err = null;
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
120 Strophe.forEachChild(e[0], null, function (child)
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
121 {
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
122 if(child.getAttribute("xmlns") == "urn:ietf:params:xml:ns:xmpp-stanzas")
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
123 err = child.nodeName;
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
124 });
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
125 this.callbacks.error(stanza, this, err);
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
126 }
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
127 }
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
128 return true;
25
2651c3a7e621 Add support for handling incoming messages to the MUC library
Matthew Wild <mwild1@gmail.com>
parents: 20
diff changeset
129 },
2651c3a7e621 Add support for handling incoming messages to the MUC library
Matthew Wild <mwild1@gmail.com>
parents: 20
diff changeset
130
2651c3a7e621 Add support for handling incoming messages to the MUC library
Matthew Wild <mwild1@gmail.com>
parents: 20
diff changeset
131 handle_message: function (stanza)
2651c3a7e621 Add support for handling incoming messages to the MUC library
Matthew Wild <mwild1@gmail.com>
parents: 20
diff changeset
132 {
2651c3a7e621 Add support for handling incoming messages to the MUC library
Matthew Wild <mwild1@gmail.com>
parents: 20
diff changeset
133 if(!this.callbacks.message)
2651c3a7e621 Add support for handling incoming messages to the MUC library
Matthew Wild <mwild1@gmail.com>
parents: 20
diff changeset
134 return true;
2651c3a7e621 Add support for handling incoming messages to the MUC library
Matthew Wild <mwild1@gmail.com>
parents: 20
diff changeset
135
2651c3a7e621 Add support for handling incoming messages to the MUC library
Matthew Wild <mwild1@gmail.com>
parents: 20
diff changeset
136 if(stanza.getAttribute("type") == "groupchat" && Strophe.getBareJidFromJid(stanza.getAttribute("from")) == this.jid)
2651c3a7e621 Add support for handling incoming messages to the MUC library
Matthew Wild <mwild1@gmail.com>
parents: 20
diff changeset
137 {
2651c3a7e621 Add support for handling incoming messages to the MUC library
Matthew Wild <mwild1@gmail.com>
parents: 20
diff changeset
138 var body = stanza.getElementsByTagName("body");
2651c3a7e621 Add support for handling incoming messages to the MUC library
Matthew Wild <mwild1@gmail.com>
parents: 20
diff changeset
139 if(body.length > 0 && stanza.getElementsByTagName("delay").length == 0)
2651c3a7e621 Add support for handling incoming messages to the MUC library
Matthew Wild <mwild1@gmail.com>
parents: 20
diff changeset
140 this.callbacks.message(stanza, this, Strophe.getResourceFromJid(stanza.getAttribute("from")), Strophe.getText(body[0]));
2651c3a7e621 Add support for handling incoming messages to the MUC library
Matthew Wild <mwild1@gmail.com>
parents: 20
diff changeset
141 }
2651c3a7e621 Add support for handling incoming messages to the MUC library
Matthew Wild <mwild1@gmail.com>
parents: 20
diff changeset
142 return true;
19
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
143 }
25
2651c3a7e621 Add support for handling incoming messages to the MUC library
Matthew Wild <mwild1@gmail.com>
parents: 20
diff changeset
144
19
41a3c9d41e6a Add MUC library to be used for conversing with helpers
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
145 };

mercurial