-- mod_message_forced_broadcast -- -- Broadcast incoming messages to all resources with the highest -- priority, regardless of whether they were addressed to a -- specific resource. -- -- You probably want to set ignore_presence_priority = true -- in the config file as well. -- -- Module hack rating: 4/5. -- local jid_bare = require "util.jid".bare; local process_to_bare; module:hook("message/full", function(data) local origin, stanza = data.origin, data.stanza; local type = stanza.attr.type; if type == "chat" or type == "headline" then -- Broadcast instead return process_to_bare(jid_bare(stanza.attr.to), origin, stanza); end end, 0.9); prosody.events.add_handler("server-started", function () -- COMPAT w/0.8-: Switch to module:global_hook() local message_full_handler = next(modulemanager.unload.hooks:get(module.host,'message')['message/full']); process_to_bare = message_full_handler.process_to_bare; end);