Changeset

1424:6969ad97ca58

mod_pep: Added handler for disco responses
author Waqas Hussain <waqas20@gmail.com>
date Fri, 26 Jun 2009 18:45:54 +0500
parents 1421:7dafb3bae02b
children 1425:8187f72b7425
files plugins/mod_pep.lua
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_pep.lua	Fri Jun 26 10:02:46 2009 +0500
+++ b/plugins/mod_pep.lua	Fri Jun 26 18:45:54 2009 +0500
@@ -91,3 +91,16 @@
 	end
 end);
 
+module:hook("iq/bare/disco", function(event)
+	local session, stanza = event.origin, event.stanza;
+	if stanza.attr.type == "result" then
+		local disco = stanza.tags[1];
+		if disco and disco.name == "query" and disco.attr.xmlns == "http://jabber.org/protocol/disco#info" then
+			-- Process disco response
+			-- TODO check if waiting for recipient's response
+			local hash; -- TODO calculate hash
+			-- TODO update hash map
+			-- TODO set recipient's data to calculated data
+		end
+	end
+end);