Mercurial > prosody-hg
comparison plugins/adhoc/mod_adhoc.lua @ 3485:3eee60c6a436
mod_adhoc: remove 0.7 compat code
| author | Florian Zeitz <florob@babelmonkeys.de> |
|---|---|
| date | Wed, 01 Sep 2010 22:46:35 +0200 |
| parents | 24d2c9be0149 |
| children | 4495403470cb |
comparison
equal
deleted
inserted
replaced
| 3484:66910810a9f7 | 3485:3eee60c6a436 |
|---|---|
| 17 module:hook("iq/host/"..xmlns_disco.."#info:query", function (event) | 17 module:hook("iq/host/"..xmlns_disco.."#info:query", function (event) |
| 18 local origin, stanza = event.origin, event.stanza; | 18 local origin, stanza = event.origin, event.stanza; |
| 19 local node = stanza.tags[1].attr.node; | 19 local node = stanza.tags[1].attr.node; |
| 20 if stanza.attr.type == "get" and node | 20 if stanza.attr.type == "get" and node |
| 21 and commands[node] then | 21 and commands[node] then |
| 22 -- Required for Prosody <= 0.7 | 22 local privileged = is_admin(stanza.attr.from, stanza.attr.to); |
| 23 local privileged = is_admin(stanza.attr.from) | |
| 24 or is_admin(stanza.attr.from, stanza.attr.to); | |
| 25 if (commands[node].permission == "admin" and privileged) | 23 if (commands[node].permission == "admin" and privileged) |
| 26 or (commands[node].permission == "user") then | 24 or (commands[node].permission == "user") then |
| 27 reply = st.reply(stanza); | 25 reply = st.reply(stanza); |
| 28 reply:tag("query", { xmlns = xmlns_disco.."#info", | 26 reply:tag("query", { xmlns = xmlns_disco.."#info", |
| 29 node = node }); | 27 node = node }); |
