Software /
code /
prosody
Comparison
plugins/mod_bosh.lua @ 2608:68c43aaf681f
mod_bosh: Fire stream-features event using new events API.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Fri, 12 Feb 2010 04:11:50 +0500 |
parent | 2486:f0335b7284b1 |
child | 2925:692b3c6c5bd2 |
comparison
equal
deleted
inserted
replaced
2607:35a5d1c5ea28 | 2608:68c43aaf681f |
---|---|
204 end | 204 end |
205 | 205 |
206 -- Send creation response | 206 -- Send creation response |
207 | 207 |
208 local features = st.stanza("stream:features"); | 208 local features = st.stanza("stream:features"); |
209 hosts[session.host].events.fire_event("stream-features", { origin = session, features = features }); | |
209 fire_event("stream-features", session, features); | 210 fire_event("stream-features", session, features); |
210 --xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh' | 211 --xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh' |
211 local response = st.stanza("body", { xmlns = xmlns_bosh, | 212 local response = st.stanza("body", { xmlns = xmlns_bosh, |
212 inactivity = tostring(BOSH_DEFAULT_INACTIVITY), polling = tostring(BOSH_DEFAULT_POLLING), requests = tostring(BOSH_DEFAULT_REQUESTS), hold = tostring(session.bosh_hold), maxpause = "120", | 213 inactivity = tostring(BOSH_DEFAULT_INACTIVITY), polling = tostring(BOSH_DEFAULT_POLLING), requests = tostring(BOSH_DEFAULT_REQUESTS), hold = tostring(session.bosh_hold), maxpause = "120", |
213 sid = sid, authid = sid, ver = '1.6', from = session.host, secure = 'true', ["xmpp:version"] = "1.0", | 214 sid = sid, authid = sid, ver = '1.6', from = session.host, secure = 'true', ["xmpp:version"] = "1.0", |
255 inactive_sessions[session] = nil; | 256 inactive_sessions[session] = nil; |
256 end | 257 end |
257 | 258 |
258 if session.notopen then | 259 if session.notopen then |
259 local features = st.stanza("stream:features"); | 260 local features = st.stanza("stream:features"); |
261 hosts[session.host].events.fire_event("stream-features", { origin = session, features = features }); | |
260 fire_event("stream-features", session, features); | 262 fire_event("stream-features", session, features); |
261 session.send(features); | 263 session.send(features); |
262 session.notopen = nil; | 264 session.notopen = nil; |
263 end | 265 end |
264 | 266 |