Software /
code /
prosody
Comparison
plugins/mod_watchregistrations.lua @ 8154:6300394bb713
Merge 0.9->0.10
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 27 May 2017 16:42:50 +0200 |
parent | 7860:49ff363f3a3d |
parent | 8152:8e26672df704 |
child | 8812:3d7fceaff230 |
comparison
equal
deleted
inserted
replaced
8149:1dc6efcc420a | 8154:6300394bb713 |
---|---|
20 module:log("debug", "Notifying of new registration"); | 20 module:log("debug", "Notifying of new registration"); |
21 local message = st.message{ type = "chat", from = registration_from } | 21 local message = st.message{ type = "chat", from = registration_from } |
22 :tag("body") | 22 :tag("body") |
23 :text(registration_notification:gsub("%$(%w+)", function (v) | 23 :text(registration_notification:gsub("%$(%w+)", function (v) |
24 return user[v] or user.session and user.session[v] or nil; | 24 return user[v] or user.session and user.session[v] or nil; |
25 end)); | 25 end)) |
26 :up(); | |
26 for jid in registration_watchers do | 27 for jid in registration_watchers do |
27 module:log("debug", "Notifying %s", jid); | 28 module:log("debug", "Notifying %s", jid); |
28 message.attr.to = jid; | 29 message.attr.to = jid; |
29 module:send(message); | 30 module:send(message); |
30 end | 31 end |