Mercurial > prosody-hg
annotate plugins/mod_roster.lua @ 99:ba08b8a4eeef
Abstract connections with "connection listeners"
- Added connlistener for xmppclient
- SASL/TLS now use a new session:reset_stream() method
- main.lua on its way to being a bit neater
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 22 Oct 2008 17:36:21 +0100 |
| parents | 2766e23c4d7d |
| children | a5b914370db5 |
| rev | line source |
|---|---|
| 30 | 1 |
| 2 local st = require "util.stanza" | |
| 3 local send = require "core.sessionmanager".send_to_session | |
| 4 | |
| 5 add_iq_handler("c2s", "jabber:iq:roster", | |
| 6 function (session, stanza) | |
| 7 if stanza.attr.type == "get" then | |
| 8 local roster = st.reply(stanza) | |
| 9 :query("jabber:iq:roster"); | |
| 10 for jid in pairs(session.roster) do | |
| 11 roster:tag("item", { jid = jid, subscription = "none" }):up(); | |
| 12 end | |
| 13 send(session, roster); | |
| 14 return true; | |
| 15 end | |
| 16 end); |
