mod_roster: Don't send a query element in roster response if roster is unchanged

Tue, 26 May 2009 01:07:21 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Tue, 26 May 2009 01:07:21 +0100
changeset 1198
545c81364939
parent 1197
1f4a4e6ae694
child 1199
db2a55fe94f2

mod_roster: Don't send a query element in roster response if roster is unchanged

plugins/mod_roster.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_roster.lua	Fri May 22 15:19:12 2009 +0100
+++ b/plugins/mod_roster.lua	Tue May 26 01:07:21 2009 +0100
@@ -35,12 +35,12 @@
 		function (session, stanza)
 			if stanza.tags[1].name == "query" then
 				if stanza.attr.type == "get" then
-					local roster = st.reply(stanza)
-								:query("jabber:iq:roster");
+					local roster = st.reply(stanza);
 					
 					local ver = stanza.tags[1].attr.ver
 					
 					if (not ver) or tonumber(ver) ~= (session.roster[false].version or 1) then
+						roster:query("jabber:iq:roster");
 						-- Client does not support versioning, or has stale roster
 						for jid in pairs(session.roster) do
 							if jid ~= "pending" and jid then

mercurial