Mercurial > prosody-modules
comparison mod_smacks/mod_smacks.lua @ 263:41f1cac40560
mod_smacks: Fixed to use the correct events API.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Sat, 16 Oct 2010 07:49:30 +0500 |
| parents | 36648205b10a |
| children | 445178d15b51 |
comparison
equal
deleted
inserted
replaced
| 262:4986ffe35704 | 263:41f1cac40560 |
|---|---|
| 11 local sm_attr = { xmlns = xmlns_sm }; | 11 local sm_attr = { xmlns = xmlns_sm }; |
| 12 | 12 |
| 13 local resume_timeout = 300; | 13 local resume_timeout = 300; |
| 14 local max_unacked_stanzas = 0; | 14 local max_unacked_stanzas = 0; |
| 15 | 15 |
| 16 module:add_event_hook("stream-features", | 16 module:hook("stream-features", |
| 17 function (session, features) | 17 function (event) |
| 18 features:tag("sm", sm_attr):tag("optional"):up():up(); | 18 event.features:tag("sm", sm_attr):tag("optional"):up():up(); |
| 19 end); | 19 end); |
| 20 | 20 |
| 21 module:hook("s2s-stream-features", | 21 module:hook("s2s-stream-features", |
| 22 function (data) | 22 function (event) |
| 23 data.features:tag("sm", sm_attr):tag("optional"):up():up(); | 23 event.features:tag("sm", sm_attr):tag("optional"):up():up(); |
| 24 end); | 24 end); |
| 25 | 25 |
| 26 module:hook_stanza(xmlns_sm, "enable", | 26 module:hook_stanza(xmlns_sm, "enable", |
| 27 function (session, stanza) | 27 function (session, stanza) |
| 28 module:log("debug", "Enabling stream management"); | 28 module:log("debug", "Enabling stream management"); |
