mod_storage_sql: Initial commit of new SQL data driver.
[prosody.git] / plugins / muc / mod_muc.lua
index 22d2664d1eca82417084837e1c1e6c2b6fe5f0be..329b927022f7ca33e4916c5a0acdbe92492fe576 100644 (file)
@@ -33,7 +33,7 @@ local um_is_admin = require "core.usermanager".is_admin;
 rooms = {};
 local rooms = rooms;
 local persistent_rooms = datamanager.load(nil, muc_host, "persistent") or {};
-local component;
+local component = hosts[module.host];
 
 -- Configurable options
 local max_history_messages = module:get_option_number("max_history_messages");
@@ -151,15 +151,15 @@ function stanza_handler(event)
        handle_to_domain(origin, stanza);
        return true;
 end
-module:hook("iq/bare", stanza_handler);
-module:hook("message/bare", stanza_handler);
-module:hook("presence/bare", stanza_handler);
-module:hook("iq/full", stanza_handler);
-module:hook("message/full", stanza_handler);
-module:hook("presence/full", stanza_handler);
-module:hook("iq/host", stanza_handler);
-module:hook("message/host", stanza_handler);
-module:hook("presence/host", stanza_handler);
+module:hook("iq/bare", stanza_handler, -1);
+module:hook("message/bare", stanza_handler, -1);
+module:hook("presence/bare", stanza_handler, -1);
+module:hook("iq/full", stanza_handler, -1);
+module:hook("message/full", stanza_handler, -1);
+module:hook("presence/full", stanza_handler, -1);
+module:hook("iq/host", stanza_handler, -1);
+module:hook("message/host", stanza_handler, -1);
+module:hook("presence/host", stanza_handler, -1);
 
 hosts[module.host].send = function(stanza) -- FIXME do a generic fix
        if stanza.attr.type == "result" or stanza.attr.type == "error" then