Software /
code /
verse
Comparison
plugins/bind.lua @ 39:07192be5020b
plugins.bind: Requested JID should be in <jid/> tag (thanks Maranda :) )
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 22 Dec 2009 01:48:01 +0000 |
parent | 9:ca225a2d67b4 |
child | 40:afd037420977 |
comparison
equal
deleted
inserted
replaced
38:c40cc28ac7df | 39:07192be5020b |
---|---|
3 | 3 |
4 function verse.plugins.bind(stream) | 4 function verse.plugins.bind(stream) |
5 local function handle_features(features) | 5 local function handle_features(features) |
6 if stream.bound then return; end | 6 if stream.bound then return; end |
7 stream:debug("Binding resource..."); | 7 stream:debug("Binding resource..."); |
8 stream:send_iq(st.iq({ type = "set" }):tag("bind", {xmlns=xmlns_bind}):text(stream.jid), | 8 stream:send_iq(st.iq({ type = "set" }):tag("bind", {xmlns=xmlns_bind}):tag("jid"):text(stream.jid), |
9 function (reply) | 9 function (reply) |
10 if reply.attr.type == "result" then | 10 if reply.attr.type == "result" then |
11 local result_jid = reply | 11 local result_jid = reply |
12 :get_child("bind", xmlns_bind) | 12 :get_child("bind", xmlns_bind) |
13 :get_child("jid") | 13 :get_child("jid") |