plugins.pep: Update for new disco/caps code

Wed, 15 Dec 2010 14:57:48 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Wed, 15 Dec 2010 14:57:48 +0000
changeset 168
7285e04a4797
parent 167
a2ae7a9d360f
child 170
cb03e8ae2e30

plugins.pep: Update for new disco/caps code

doc/example_pep.lua file | annotate | diff | comparison | revisions
--- a/doc/example_pep.lua	Wed Dec 15 14:56:10 2010 +0000
+++ b/doc/example_pep.lua	Wed Dec 15 14:57:48 2010 +0000
@@ -34,6 +34,7 @@
 -- Catch the "ready" event to know when the stream is ready to use
 c:hook("ready", function ()
 	print("Stream ready!");
+	c:send(verse.presence());
 	c.version:set{ name = "verse example client" };
 	c:publish_pep(verse.stanza("tune", { xmlns = "http://jabber.org/protocol/tune" })
 		:tag("title"):text("Beautiful Cedars"):up()
@@ -45,7 +46,10 @@
 	c:hook_pep("http://jabber.org/protocol/mood", function (event)
 		print(event.from.." is "..event.item.tags[1].name);
 	end);
-	c:send(verse.presence():add_child(c:caps()));
+	
+	c:hook_pep("http://jabber.org/protocol/tune", function (event)
+		print(event.from.." is listening to "..event.item:get_child("title"):get_text());
+	end);
 end);
 
 print("Starting loop...")

mercurial