Software /
code /
prosody
Comparison
plugins/mod_announce.lua @ 8974:71500c68fed4
mod_announce: Fix luacheck warnings
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 06 Jul 2018 00:16:48 +0200 |
parent | 8960:9d0d1e427b82 |
child | 10026:1117138fa372 |
comparison
equal
deleted
inserted
replaced
8973:188c05e906f1 | 8974:71500c68fed4 |
---|---|
35 end | 35 end |
36 | 36 |
37 | 37 |
38 -- Old <message>-based jabberd-style announcement sending | 38 -- Old <message>-based jabberd-style announcement sending |
39 function handle_announcement(event) | 39 function handle_announcement(event) |
40 local origin, stanza = event.origin, event.stanza; | 40 local stanza = event.stanza; |
41 local node, host, resource = jid.split(stanza.attr.to); | 41 local node, host, resource = jid.split(stanza.attr.to); |
42 | 42 |
43 if resource ~= "announce/online" then | 43 if resource ~= "announce/online" then |
44 return; -- Not an announcement | 44 return; -- Not an announcement |
45 end | 45 end |
70 { name = "FORM_TYPE", type = "hidden", value = "http://jabber.org/protocol/admin" }; | 70 { name = "FORM_TYPE", type = "hidden", value = "http://jabber.org/protocol/admin" }; |
71 { name = "subject", type = "text-single", label = "Subject" }; | 71 { name = "subject", type = "text-single", label = "Subject" }; |
72 { name = "announcement", type = "text-multi", required = true, label = "Announcement" }; | 72 { name = "announcement", type = "text-multi", required = true, label = "Announcement" }; |
73 }; | 73 }; |
74 | 74 |
75 function announce_handler(self, data, state) | 75 function announce_handler(_, data, state) |
76 if state then | 76 if state then |
77 if data.action == "cancel" then | 77 if data.action == "cancel" then |
78 return { status = "canceled" }; | 78 return { status = "canceled" }; |
79 end | 79 end |
80 | 80 |