plugins/mod_watchregistrations.lua
changeset 8157 6300394bb713
parent 7863 49ff363f3a3d
parent 8155 8e26672df704
child 8815 3d7fceaff230
equal deleted inserted replaced
8152:1dc6efcc420a 8157: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