# HG changeset patch # User Matthew Wild # Date 1292425068 0 # Node ID 7285e04a47975ab4dc480fe5ef44c17a4c019541 # Parent a2ae7a9d360f672d0704539d273a5c95962b0a22 plugins.pep: Update for new disco/caps code diff -r a2ae7a9d360f -r 7285e04a4797 doc/example_pep.lua --- 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...")