# HG changeset patch # User daurnimator # Date 1395244995 14400 # Node ID f8b94903be524666b885d0c0aaefaba9543c4893 # Parent d007b3c490788223e2cb8670e73532244fd41d9f plugins/muc: Provide a reasonable default `route_stanza` diff -r d007b3c49078 -r f8b94903be52 plugins/muc/mod_muc.lua --- a/plugins/muc/mod_muc.lua Tue Mar 18 18:56:26 2014 -0400 +++ b/plugins/muc/mod_muc.lua Wed Mar 19 12:03:15 2014 -0400 @@ -64,7 +64,6 @@ return _set_affiliation(self, actor, jid, affiliation, callback, reason); end -local function room_route_stanza(room, stanza) module:send(stanza); end local function room_save(room, forced) local node = jid_split(room.jid); persistent_rooms[room.jid] = room._data.persistent; @@ -89,7 +88,6 @@ function create_room(jid) local room = muc_new_room(jid); - room.route_stanza = room_route_stanza; room.save = room_save; rooms[jid] = room; if lock_rooms then @@ -131,7 +129,6 @@ if persistent_errors then persistent_rooms_storage:set(nil, persistent_rooms); end local host_room = muc_new_room(muc_host); -host_room.route_stanza = room_route_stanza; host_room.save = room_save; rooms[muc_host] = host_room; diff -r d007b3c49078 -r f8b94903be52 plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Tue Mar 18 18:56:26 2014 -0400 +++ b/plugins/muc/muc.lib.lua Wed Mar 19 12:03:15 2014 -0400 @@ -1145,7 +1145,9 @@ end end -function room_mt:route_stanza(stanza) end -- Replace with a routing function, e.g., function(room, stanza) core_route_stanza(origin, stanza); end +function room_mt:route_stanza(stanza) + module:send(stanza) +end function room_mt:get_affiliation(jid) local node, host, resource = jid_split(jid);