# HG changeset patch # User Matthew Wild # Date 1274436703 -3600 # Node ID 1789dac44823d5c96885c486eddbfc15a5785997 # Parent 8154b72591d50d30baa8b67c8b0185bc119a7bb5 plugins.session: Convert from Windows line endings diff -r 8154b72591d5 -r 1789dac44823 plugins/session.lua --- a/plugins/session.lua Tue May 11 23:19:01 2010 +0100 +++ b/plugins/session.lua Fri May 21 11:11:43 2010 +0100 @@ -1,20 +1,20 @@ -local st = require "util.stanza"; -local xmlns_session = "urn:ietf:params:xml:ns:xmpp-session"; - -function verse.plugins.session(stream) - local function handle_binding(jid) - stream:debug("Establishing Session..."); - stream:send_iq(st.iq({ type = "set" }):tag("session", {xmlns=xmlns_session}), - function (reply) - if reply.attr.type == "result" then - stream:event("session-success"); - elseif reply.attr.type == "error" then - local err = reply:child_with_name("error"); - local type, condition, text = reply:get_error(); - stream:event("session-failure", { error = condition, text = text, type = type }); - end - end); - end - stream:hook("binding-success", handle_binding); - return true; -end +local st = require "util.stanza"; +local xmlns_session = "urn:ietf:params:xml:ns:xmpp-session"; + +function verse.plugins.session(stream) + local function handle_binding(jid) + stream:debug("Establishing Session..."); + stream:send_iq(st.iq({ type = "set" }):tag("session", {xmlns=xmlns_session}), + function (reply) + if reply.attr.type == "result" then + stream:event("session-success"); + elseif reply.attr.type == "error" then + local err = reply:child_with_name("error"); + local type, condition, text = reply:get_error(); + stream:event("session-failure", { error = condition, text = text, type = type }); + end + end); + end + stream:hook("binding-success", handle_binding); + return true; +end