Created
March 21, 2014 16:42
-
-
Save DazWorrall/9690373 to your computer and use it in GitHub Desktop.
Hacking prosody mod_post_msg to support announcing to MUC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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