Software /
code /
verse
Changeset
168:7285e04a4797
plugins.pep: Update for new disco/caps code
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 15 Dec 2010 14:57:48 +0000 |
parents | 167:a2ae7a9d360f |
children | 170:cb03e8ae2e30 |
files | doc/example_pep.lua |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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...")