Mercurial > prosody-hg
comparison plugins/mod_pubsub.lua @ 5445:9054b51e71a4
mod_pubsub: Send bad-request when no action specified (thanks Maranda)
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Mon, 08 Apr 2013 15:32:24 +0100 |
| parents | 92615cfa2270 |
| children | 81c599c7588b |
comparison
equal
deleted
inserted
replaced
| 5443:92615cfa2270 | 5445:9054b51e71a4 |
|---|---|
| 20 | 20 |
| 21 function handle_pubsub_iq(event) | 21 function handle_pubsub_iq(event) |
| 22 local origin, stanza = event.origin, event.stanza; | 22 local origin, stanza = event.origin, event.stanza; |
| 23 local pubsub = stanza.tags[1]; | 23 local pubsub = stanza.tags[1]; |
| 24 local action = pubsub.tags[1]; | 24 local action = pubsub.tags[1]; |
| 25 if not action then return; end | 25 if not action then |
| 26 return origin.send(st.error_reply(stanza, "cancel", "bad-request")); | |
| 27 end | |
| 26 local handler = handlers[stanza.attr.type.."_"..action.name]; | 28 local handler = handlers[stanza.attr.type.."_"..action.name]; |
| 27 if handler then | 29 if handler then |
| 28 handler(origin, stanza, action); | 30 handler(origin, stanza, action); |
| 29 return true; | 31 return true; |
| 30 end | 32 end |
