Skip to content

Instantly share code, notes, and snippets.

@DazWorrall
Created March 21, 2014 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DazWorrall/9690373 to your computer and use it in GitHub Desktop.
Save DazWorrall/9690373 to your computer and use it in GitHub Desktop.
Hacking prosody mod_post_msg to support announcing to MUC
if message and message.attr.type == "groupchat" then
local m = hosts[module.host].modules;
local mu = m.muc;
local room = mu.rooms[message.attr.to];
if not room then return 414; end -- better code here. 404?
message.attr.from = message.attr.to;
module:log("debug", "Sending %s", tostring(message));
room:broadcast_message(message);
return 201;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment