Comparison

plugins/mod_announce.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
parent 12642:9061f9621330
comparison
equal deleted inserted replaced
12976:a187600ec7d6 12977:74b9e05af71e
4 -- 4 --
5 -- This project is MIT/X11 licensed. Please see the 5 -- This project is MIT/X11 licensed. Please see the
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 local st, jid = require "util.stanza", require "util.jid"; 9 local st, jid = require "prosody.util.stanza", require "prosody.util.jid";
10 10
11 local hosts = prosody.hosts; 11 local hosts = prosody.hosts;
12 12
13 function send_to_online(message, host) 13 function send_to_online(message, host)
14 local sessions; 14 local sessions;
61 return true; 61 return true;
62 end 62 end
63 module:hook("message/host", handle_announcement); 63 module:hook("message/host", handle_announcement);
64 64
65 -- Ad-hoc command (XEP-0133) 65 -- Ad-hoc command (XEP-0133)
66 local dataforms_new = require "util.dataforms".new; 66 local dataforms_new = require "prosody.util.dataforms".new;
67 local announce_layout = dataforms_new{ 67 local announce_layout = dataforms_new{
68 title = "Making an Announcement"; 68 title = "Making an Announcement";
69 instructions = "Fill out this form to make an announcement to all\nactive users of this service."; 69 instructions = "Fill out this form to make an announcement to all\nactive users of this service.";
70 70
71 { name = "FORM_TYPE", type = "hidden", value = "http://jabber.org/protocol/admin" }; 71 { name = "FORM_TYPE", type = "hidden", value = "http://jabber.org/protocol/admin" };