Diff

plugins/mod_presence.lua @ 3968:048af3ee5899

core.offlinemanager, mod_message, mod_presence: Removed core.offlinemanager in favor of mod_offline.
author Robert Hoelz <rob@hoelz.ro>
date Thu, 09 Dec 2010 12:23:37 -0600
parent 3540:bc139431830b
child 3969:32d4a73901e2
line wrap: on
line diff
--- a/plugins/mod_presence.lua	Mon Dec 27 06:10:34 2010 +0500
+++ b/plugins/mod_presence.lua	Thu Dec 09 12:23:37 2010 -0600
@@ -22,7 +22,6 @@
 
 local rostermanager = require "core.rostermanager";
 local sessionmanager = require "core.sessionmanager";
-local offlinemanager = require "core.offlinemanager";
 
 local function select_top_resources(user)
 	local priority = 0;
@@ -116,13 +115,9 @@
 		end
 
 		if priority >= 0 then
-			local offline = offlinemanager.load(node, host);
-			if offline then
-				for _, msg in ipairs(offline) do
-					origin.send(msg); -- FIXME do we need to modify to/from in any way?
-				end
-				offlinemanager.deleteAll(node, host);
-			end
+                        local event = { origin = origin }
+                        module:fire_event('message/offline/broadcast', event);
+                        module:fire_event('message/offline/delete', event);
 		end
 	end
 	if stanza.attr.type == "unavailable" then