Mercurial > prosody-hg
comparison plugins/mod_watchregistrations.lua @ 12977:74b9e05af71e
plugins: Prefix module imports with prosody namespace
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 24 Mar 2023 13:15:28 +0100 |
| parents | 3d7fceaff230 |
| children | 173038306750 |
comparison
equal
deleted
inserted
replaced
| 12976:a187600ec7d6 | 12977:74b9e05af71e |
|---|---|
| 6 -- COPYING file in the source package for more information. | 6 -- COPYING file in the source package for more information. |
| 7 -- | 7 -- |
| 8 | 8 |
| 9 | 9 |
| 10 local host = module:get_host(); | 10 local host = module:get_host(); |
| 11 local jid_prep = require "util.jid".prep; | 11 local jid_prep = require "prosody.util.jid".prep; |
| 12 | 12 |
| 13 local registration_watchers = module:get_option_set("registration_watchers", module:get_option("admins", {})) / jid_prep; | 13 local registration_watchers = module:get_option_set("registration_watchers", module:get_option("admins", {})) / jid_prep; |
| 14 local registration_from = module:get_option_string("registration_from", host); | 14 local registration_from = module:get_option_string("registration_from", host); |
| 15 local registration_notification = module:get_option_string("registration_notification", "User $username just registered on $host from $ip"); | 15 local registration_notification = module:get_option_string("registration_notification", "User $username just registered on $host from $ip"); |
| 16 local msg_type = module:get_option_string("registration_notification_type", "chat"); | 16 local msg_type = module:get_option_string("registration_notification_type", "chat"); |
| 17 | 17 |
| 18 local st = require "util.stanza"; | 18 local st = require "prosody.util.stanza"; |
| 19 | 19 |
| 20 module:hook("user-registered", function (user) | 20 module:hook("user-registered", function (user) |
| 21 module:log("debug", "Notifying of new registration"); | 21 module:log("debug", "Notifying of new registration"); |
| 22 local message = st.message{ type = msg_type, from = registration_from } | 22 local message = st.message{ type = msg_type, from = registration_from } |
| 23 :tag("body") | 23 :tag("body") |
