Software /
code /
verse
Diff
plugins/jingle.lua @ 197:7e98cf2c1d8d
plugins.*: Use verse.stanza() & co instead of require util.stanza
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 17 Mar 2011 18:33:52 +0100 |
parent | 140:97bf22d6ff96 |
child | 211:837cd09fcf01 |
line wrap: on
line diff
--- a/plugins/jingle.lua Thu Mar 17 01:30:44 2011 +0100 +++ b/plugins/jingle.lua Thu Mar 17 18:33:52 2011 +0100 @@ -1,5 +1,4 @@ local sha1 = require "util.sha1".sha1; -local st = require "util.stanza"; local timer = require "util.timer"; local uuid_generate = require "util.uuid".generate; @@ -52,7 +51,7 @@ -- No existing Jingle object handled this action, our turn... if action ~= "session-initiate" then -- Trying to send a command to a session we don't know - local reply = st.error_reply(stanza, "cancel", "item-not-found") + local reply = verse.error_reply(stanza, "cancel", "item-not-found") :tag("unknown-session", { xmlns = xmlns_jingle_errors }):up(); stream:send(reply); return; @@ -97,17 +96,17 @@ end if not content then -- FIXME: Fail, no content - stream:send(st.error_reply(stanza, "cancel", "feature-not-implemented", "The specified content is not supported")); + stream:send(verse.error_reply(stanza, "cancel", "feature-not-implemented", "The specified content is not supported")); return; end if not transport then -- FIXME: Refuse session, no transport - stream:send(st.error_reply(stanza, "cancel", "feature-not-implemented", "The specified transport is not supported")); + stream:send(verse.error_reply(stanza, "cancel", "feature-not-implemented", "The specified transport is not supported")); return; end - stream:send(st.reply(stanza)); + stream:send(verse.reply(stanza)); jingle.content_tag = content_tag; jingle.creator, jingle.name = content_tag.attr.creator, content_tag.attr.name; @@ -152,7 +151,7 @@ end function jingle_mt:send_command(command, element, callback) - local stanza = st.iq({ to = self.peer, type = "set" }) + local stanza = verse.iq({ to = self.peer, type = "set" }) :tag("jingle", { xmlns = xmlns_jingle, sid = self.sid, @@ -168,7 +167,7 @@ end function jingle_mt:accept(options) - local accept_stanza = st.iq({ to = self.peer, type = "set" }) + local accept_stanza = verse.iq({ to = self.peer, type = "set" }) :tag("jingle", { xmlns = xmlns_jingle, sid = self.sid, @@ -204,7 +203,7 @@ end function jingle_mt:offer(name, content) - local session_initiate = st.iq({ to = self.peer, type = "set" }) + local session_initiate = verse.iq({ to = self.peer, type = "set" }) :tag("jingle", { xmlns = xmlns_jingle, action = "session-initiate", initiator = self.stream.jid, sid = self.sid });