Diff

plugins/mod_presence.lua @ 6302:76699a0ae4c4

mod_lastactivity, mod_legacyauth, mod_presence, mod_saslauth, mod_tls: Use the newer stanza:get_child APIs and optimize away some table lookups
author Kim Alvefur <zash@zash.se>
date Fri, 04 Jul 2014 22:52:34 +0200
parent 6291:7a604381d6fc
child 6613:2aae36312eb9
line wrap: on
line diff
--- a/plugins/mod_presence.lua	Fri Jul 04 21:48:25 2014 +0200
+++ b/plugins/mod_presence.lua	Fri Jul 04 22:52:34 2014 +0200
@@ -55,14 +55,14 @@
 
 function handle_normal_presence(origin, stanza)
 	if ignore_presence_priority then
-		local priority = stanza:child_with_name("priority");
+		local priority = stanza:get_child("priority");
 		if priority and priority[1] ~= "0" then
 			for i=#priority.tags,1,-1 do priority.tags[i] = nil; end
 			for i=#priority,1,-1 do priority[i] = nil; end
 			priority[1] = "0";
 		end
 	end
-	local priority = stanza:child_with_name("priority");
+	local priority = stanza:get_child("priority");
 	if priority and #priority > 0 then
 		priority = t_concat(priority);
 		if s_find(priority, "^[+-]?[0-9]+$") then