Software /
code /
prosody
Comparison
plugins/adhoc/mod_adhoc.lua @ 3286:e5234625fc42
mod_adhoc: Update for new is_admin usage
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 22 Jun 2010 19:04:10 +0100 |
parent | 3231:ad3fbed1dda5 |
child | 3456:1201a743fe63 |
comparison
equal
deleted
inserted
replaced
3285:c116c4b2db5a | 3286:e5234625fc42 |
---|---|
13 | 13 |
14 module:add_feature(xmlns_cmd); | 14 module:add_feature(xmlns_cmd); |
15 | 15 |
16 module:hook("iq/host/"..xmlns_disco.."#items:query", function (event) | 16 module:hook("iq/host/"..xmlns_disco.."#items:query", function (event) |
17 local origin, stanza = event.origin, event.stanza; | 17 local origin, stanza = event.origin, event.stanza; |
18 -- TODO: Is this correct, or should is_admin be changed? | 18 local privileged = is_admin(stanza.attr.from, stanza.attr.to); |
19 local privileged = is_admin(stanza.attr.from) | |
20 or is_admin(stanza.attr.from, stanza.attr.to); | |
21 if stanza.attr.type == "get" and stanza.tags[1].attr.node | 19 if stanza.attr.type == "get" and stanza.tags[1].attr.node |
22 and stanza.tags[1].attr.node == xmlns_cmd then | 20 and stanza.tags[1].attr.node == xmlns_cmd then |
23 reply = st.reply(stanza); | 21 reply = st.reply(stanza); |
24 reply:tag("query", { xmlns = xmlns_disco.."#items", | 22 reply:tag("query", { xmlns = xmlns_disco.."#items", |
25 node = xmlns_cmd }); | 23 node = xmlns_cmd }); |