MUC: Ignore invisible presence (incorrectly broadcasted or forwarded by ejabberd).
[prosody.git] / plugins / muc / mod_muc.lua
index 28002459a9415e52b8f79201c7697bd10640699d..3e6fafb85d217a723262857ea93d66edee894fb1 100644 (file)
@@ -31,9 +31,7 @@ local function room_route_stanza(room, stanza) core_post_stanza(component, stanz
 local function room_save(room, forced)
        local node = jid_split(room.jid);
        persistent_rooms[room.jid] = room._data.persistent;
-       module:log("debug", "1, %s, %s", room.jid, tostring(room._data.persistent));
        if room._data.persistent then
-               module:log("debug", "2");
                local history = room._data.history;
                room._data.history = nil;
                local data = {
@@ -44,10 +42,8 @@ local function room_save(room, forced)
                datamanager.store(node, muc_host, "config", data);
                room._data.history = history;
        elseif forced then
-               module:log("debug", "3");
                datamanager.store(node, muc_host, "config", nil);
        end
-       module:log("debug", "4");
        if forced then datamanager.store(nil, muc_host, "persistent", persistent_rooms); end
 end
 
@@ -123,6 +119,11 @@ component = register_component(muc_host, function(origin, stanza)
        -- to the main muc domain
        handle_to_domain(origin, stanza);
 end);
+function component.send(stanza) -- FIXME do a generic fix
+       if stanza.attr.type == "result" or stanza.attr.type == "error" then
+               core_post_stanza(component, stanza);
+       else error("component.send only supports result and error stanzas at the moment"); end
+end
 
 prosody.hosts[module:get_host()].muc = { rooms = rooms };