Mercurial > prosody-hg
comparison plugins/mod_watchregistrations.lua @ 4477:b34eee3712c3
mod_watchregistrations: Fixed an undefined global access (thanks Medics).
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Mon, 12 Dec 2011 14:53:12 +0500 |
| parents | 71083327f608 |
| children | 01bfb9a76660 |
comparison
equal
deleted
inserted
replaced
| 4476:53ce21286b8c | 4477:b34eee3712c3 |
|---|---|
| 16 | 16 |
| 17 module:hook("user-registered", function (user) | 17 module:hook("user-registered", function (user) |
| 18 module:log("debug", "Notifying of new registration"); | 18 module:log("debug", "Notifying of new registration"); |
| 19 local message = st.message{ type = "chat", from = host } | 19 local message = st.message{ type = "chat", from = host } |
| 20 :tag("body") | 20 :tag("body") |
| 21 :text(registration_alert:gsub("%$(%w+)", function (v) | 21 :text(registration_notification:gsub("%$(%w+)", function (v) |
| 22 return user[v] or user.session and user.session[v] or nil; | 22 return user[v] or user.session and user.session[v] or nil; |
| 23 end)); | 23 end)); |
| 24 for _, jid in ipairs(registration_watchers) do | 24 for _, jid in ipairs(registration_watchers) do |
| 25 module:log("debug", "Notifying %s", jid); | 25 module:log("debug", "Notifying %s", jid); |
| 26 message.attr.to = jid; | 26 message.attr.to = jid; |
