Prosody top-level error handler modified to log properly on non-string error messages.
[prosody.git] / plugins / mod_pep.lua
index 66197f7a93f0f6a1d4936ace46d948c67d15bd3c..bfe2286763117a299ce2e4bb641e922a15f99828 100644 (file)
@@ -25,6 +25,15 @@ local data = {};
 local recipients = {};
 local hash_map = {};
 
+module.save = function()
+       return { data = data, recipients = recipients, hash_map = hash_map };
+end
+module.restore = function(state)
+       data = state.data or {};
+       recipients = state.recipients or {};
+       hash_map = state.hash_map or {};
+end
+
 module:add_identity("pubsub", "pep", "Prosody");
 module:add_feature("http://jabber.org/protocol/pubsub#publish");
 
@@ -134,8 +143,8 @@ module:hook("iq/bare/http://jabber.org/protocol/pubsub:pubsub", function(event)
                                local node = payload.attr.node;
                                payload = payload.tags[1];
                                if payload and payload.name == "item" then -- <item>
-                                       publish(session, node, st.clone(payload));
                                        session.send(st.reply(stanza));
+                                       publish(session, node, st.clone(payload));
                                        return true;
                                end
                        end