core/stanza_router.lua

changeset 1407
85ec12aec35f
parent 1406
83c6fb3d9e73
child 1408
9b745496b953
--- a/core/stanza_router.lua	Thu Jun 25 07:57:57 2009 +0500
+++ b/core/stanza_router.lua	Thu Jun 25 07:59:04 2009 +0500
@@ -31,8 +31,6 @@
 local jid_prepped_split = require "util.jid".prepped_split;
 local fire_event = prosody.events.fire_event;
 
-local select_best_resources;
-
 function core_process_stanza(origin, stanza)
 	(origin.log or log)("debug", "Received[%s]: %s", origin.type, stanza:top_tag())
 
@@ -231,20 +229,3 @@
 	end
 	stanza.attr.to = to; -- reset
 end
-
-function select_best_resources(user)
-	local priority = 0;
-	local recipients = {};
-	for _, session in pairs(user.sessions) do -- find resource with greatest priority
-		if session.presence then
-			local p = session.priority;
-			if p > priority then
-				priority = p;
-				recipients = {session};
-			elseif p == priority then
-				t_insert(recipients, session);
-			end
-		end
-	end
-	return recipients;
-end

mercurial