Software / code / prosody
Comparison
plugins/mod_announce.lua @ 13485:3bdbaba15c00
mod_announce: Suppress luacheck warnings
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Fri, 26 Apr 2024 10:37:20 +0100 |
| parent | 13484:e22609460975 |
comparison
equal
deleted
inserted
replaced
| 13484:e22609460975 | 13485:3bdbaba15c00 |
|---|---|
| 135 args = { | 135 args = { |
| 136 { name = "host", type = "string" }; | 136 { name = "host", type = "string" }; |
| 137 { name = "text", type = "string" }; | 137 { name = "text", type = "string" }; |
| 138 }; | 138 }; |
| 139 host_selector = "host"; | 139 host_selector = "host"; |
| 140 handler = function(self, host, text) | 140 handler = function(self, host, text) --luacheck: ignore 212/self |
| 141 local msg = st.message({ from = host, id = id.short() }) | 141 local msg = st.message({ from = host, id = id.short() }) |
| 142 :text_tag("body", text); | 142 :text_tag("body", text); |
| 143 local count = send_to_all(msg, host); | 143 local count = send_to_all(msg, host); |
| 144 return true, ("Announcement sent to %d users"):format(count); | 144 return true, ("Announcement sent to %d users"):format(count); |
| 145 end; | 145 end; |
| 153 args = { | 153 args = { |
| 154 { name = "host", type = "string" }; | 154 { name = "host", type = "string" }; |
| 155 { name = "text", type = "string" }; | 155 { name = "text", type = "string" }; |
| 156 }; | 156 }; |
| 157 host_selector = "host"; | 157 host_selector = "host"; |
| 158 handler = function(self, host, text) | 158 handler = function(self, host, text) --luacheck: ignore 212/self |
| 159 local msg = st.message({ from = host, id = id.short(), type = "headline" }) | 159 local msg = st.message({ from = host, id = id.short(), type = "headline" }) |
| 160 :text_tag("body", text); | 160 :text_tag("body", text); |
| 161 local count = send_to_online(msg, host); | 161 local count = send_to_online(msg, host); |
| 162 return true, ("Announcement sent to %d users"):format(count); | 162 return true, ("Announcement sent to %d users"):format(count); |
| 163 end; | 163 end; |
| 172 { name = "host", type = "string" }; | 172 { name = "host", type = "string" }; |
| 173 { name = "role", type = "string" }; | 173 { name = "role", type = "string" }; |
| 174 { name = "text", type = "string" }; | 174 { name = "text", type = "string" }; |
| 175 }; | 175 }; |
| 176 host_selector = "host"; | 176 host_selector = "host"; |
| 177 handler = function(self, host, role, text) | 177 handler = function(self, host, role, text) --luacheck: ignore 212/self |
| 178 local msg = st.message({ from = host, id = id.short() }) | 178 local msg = st.message({ from = host, id = id.short() }) |
| 179 :text_tag("body", text); | 179 :text_tag("body", text); |
| 180 local count = send_to_role(msg, role, host); | 180 local count = send_to_role(msg, role, host); |
| 181 return true, ("Announcement sent to %d users"):format(count); | 181 return true, ("Announcement sent to %d users"):format(count); |
| 182 end; | 182 end; |