Mercurial > prosody-hg
comparison plugins/mod_watchregistrations.lua @ 8152:8e26672df704
mod_watchregistrations: Return the pointer to the root of the stanza, fixes #922.
| author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
|---|---|
| date | Sat, 27 May 2017 14:23:43 +0100 |
| parents | b2006c1cfa85 |
| children | 6300394bb713 |
comparison
equal
deleted
inserted
replaced
| 8151:2c65f8be38aa | 8152:8e26672df704 |
|---|---|
| 19 module:log("debug", "Notifying of new registration"); | 19 module:log("debug", "Notifying of new registration"); |
| 20 local message = st.message{ type = "chat", from = host } | 20 local message = st.message{ type = "chat", from = host } |
| 21 :tag("body") | 21 :tag("body") |
| 22 :text(registration_notification:gsub("%$(%w+)", function (v) | 22 :text(registration_notification:gsub("%$(%w+)", function (v) |
| 23 return user[v] or user.session and user.session[v] or nil; | 23 return user[v] or user.session and user.session[v] or nil; |
| 24 end)); | 24 end)) |
| 25 :up(); | |
| 25 for jid in registration_watchers do | 26 for jid in registration_watchers do |
| 26 module:log("debug", "Notifying %s", jid); | 27 module:log("debug", "Notifying %s", jid); |
| 27 message.attr.to = jid; | 28 message.attr.to = jid; |
| 28 module:send(message); | 29 module:send(message); |
| 29 end | 30 end |
