Comparison

plugins/muc/mod_muc.lua @ 5015:f19b38bfa015

mod_muc: Use module:send() instead of core_*_stanza()
author Kim Alvefur <zash@zash.se>
date Thu, 26 Jul 2012 04:41:56 +0200
parent 4924:d8b9fe5900a2
child 5016:56a0b13a3d42
comparison
equal deleted inserted replaced
5014:b2006c1cfa85 5015:f19b38bfa015
40 40
41 local function is_admin(jid) 41 local function is_admin(jid)
42 return um_is_admin(jid, module.host); 42 return um_is_admin(jid, module.host);
43 end 43 end
44 44
45 local function room_route_stanza(room, stanza) core_post_stanza(component, stanza); end 45 local function room_route_stanza(room, stanza) module:send(stanza); end
46 local function room_save(room, forced) 46 local function room_save(room, forced)
47 local node = jid_split(room.jid); 47 local node = jid_split(room.jid);
48 persistent_rooms[room.jid] = room._data.persistent; 48 persistent_rooms[room.jid] = room._data.persistent;
49 if room._data.persistent then 49 if room._data.persistent then
50 local history = room._data.history; 50 local history = room._data.history;
166 module:hook("message/host", handle_to_domain, -1); 166 module:hook("message/host", handle_to_domain, -1);
167 module:hook("presence/host", handle_to_domain, -1); 167 module:hook("presence/host", handle_to_domain, -1);
168 168
169 hosts[module.host].send = function(stanza) -- FIXME do a generic fix 169 hosts[module.host].send = function(stanza) -- FIXME do a generic fix
170 if stanza.attr.type == "result" or stanza.attr.type == "error" then 170 if stanza.attr.type == "result" or stanza.attr.type == "error" then
171 core_post_stanza(component, stanza); 171 module:send(stanza);
172 else error("component.send only supports result and error stanzas at the moment"); end 172 else error("component.send only supports result and error stanzas at the moment"); end
173 end 173 end
174 174
175 prosody.hosts[module:get_host()].muc = { rooms = rooms }; 175 prosody.hosts[module:get_host()].muc = { rooms = rooms };
176 176