plugins/mod_message.lua

changeset 3970
0f9ab57a1aee
parent 3968
048af3ee5899
child 3972
a05cf5d9c7ab
--- a/plugins/mod_message.lua	Thu Dec 09 12:28:05 2010 -0600
+++ b/plugins/mod_message.lua	Thu Dec 09 12:36:29 2010 -0600
@@ -44,14 +44,17 @@
 		end
 		-- no resources are online
 		local node, host = jid_split(bare);
+		local ok
 		if user_exists(node, host) then
 			-- TODO apply the default privacy list
 
-                        module:fire_event('message/offline/store', {
-                            origin = origin,
-                            stanza = stanza,
-                        });
-		else
+			ok = module:fire_event('message/offline/store', {
+			    origin = origin,
+			    stanza = stanza,
+			});
+		end
+
+		if not ok then
 			origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
 		end
 	end

mercurial