Software /
code /
prosody
Changeset
6111:f8b94903be52
plugins/muc: Provide a reasonable default `route_stanza`
author | daurnimator <quae@daurnimator.com> |
---|---|
date | Wed, 19 Mar 2014 12:03:15 -0400 |
parents | 6110:d007b3c49078 |
children | 6112:819e00a86239 |
files | plugins/muc/mod_muc.lua plugins/muc/muc.lib.lua |
diffstat | 2 files changed, 3 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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;
--- 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);