Software /
code /
verse
Changeset
176:6004486e8b6c
plugins.disco,compression: Use xmlns_* variables
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 31 Dec 2010 01:10:57 +0100 (2010-12-31) |
parents | 175:4d2a5d02fdfa |
children | 177:0ffb565fcfd6 |
files | plugins/compression.lua plugins/disco.lua |
diffstat | 2 files changed, 12 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/compression.lua Fri Dec 31 00:30:37 2010 +0100 +++ b/plugins/compression.lua Fri Dec 31 01:10:57 2010 +0100 @@ -47,7 +47,7 @@ session:close({ condition = "undefined-condition"; text = compressed; - extra = st.stanza("failure", {xmlns="http://jabber.org/protocol/compress"}):tag("processing-failed"); + extra = st.stanza("failure", {xmlns=xmlns_compression_protocol}):tag("processing-failed"); }); session:warn("Compressed send failed: %s", tostring(compressed)); return; @@ -66,7 +66,7 @@ session:close({ condition = "undefined-condition"; text = decompressed; - extra = st.stanza("failure", {xmlns="http://jabber.org/protocol/compress"}):tag("processing-failed"); + extra = st.stanza("failure", {xmlns=xmlns_compression_protocol}):tag("processing-failed"); }); stream:warn("%s", tostring(decompressed)); return;
--- a/plugins/disco.lua Fri Dec 31 00:30:37 2010 +0100 +++ b/plugins/disco.lua Fri Dec 31 01:10:57 2010 +0100 @@ -21,9 +21,9 @@ {category = 'client', type='pc', name='Verse'}, } stream.disco.info.features = { - {var = 'http://jabber.org/protocol/caps'}, - {var = 'http://jabber.org/protocol/disco#info'}, - {var = 'http://jabber.org/protocol/disco#items'}, + {var = xmlns_caps}, + {var = xmlns_disco_info}, + {var = xmlns_disco_items}, } stream.disco.items = {} stream.disco.nodes = {} @@ -81,7 +81,7 @@ -- presence stanza local hash = calculate_hash() return st.stanza('c', { - xmlns = 'http://jabber.org/protocol/caps', + xmlns = xmlns_caps, hash = 'sha-1', node = stream.caps.node, ver = hash @@ -255,7 +255,7 @@ end); end - stream:hook("iq/http://jabber.org/protocol/disco#info", function (stanza) + stream:hook("iq/"..xmlns_disco_info, function (stanza) if stanza.attr.type == 'get' then local query = stanza:child_with_name('query') if not query then return; end @@ -280,7 +280,7 @@ id = stanza.attr.id, type = 'error' }) - response:tag('query',{xmlns = 'http://jabber.org/protocol/disco#info'}):reset() + response:tag('query',{xmlns = xmlns_disco_info}):reset() response:tag('error',{type = 'cancel'}):tag( 'item-not-found',{xmlns = 'urn:ietf:params:xml:ns:xmpp-stanzas'} ) @@ -293,7 +293,7 @@ end -- construct the response local result = st.stanza('query',{ - xmlns = 'http://jabber.org/protocol/disco#info', + xmlns = xmlns_disco_info, node = query.attr.node }) for key,identity in pairs(identities) do @@ -312,7 +312,7 @@ end end); - stream:hook("iq/http://jabber.org/protocol/disco#items", function (stanza) + stream:hook("iq/"..xmlns_disco_items, function (stanza) if stanza.attr.type == 'get' then local query = stanza:child_with_name('query') if not query then return; end @@ -330,7 +330,7 @@ id = stanza.attr.id, type = 'error' }) - response:tag('query',{xmlns = 'http://jabber.org/protocol/disco#items'}):reset() + response:tag('query',{xmlns = xmlns_disco_items}):reset() response:tag('error',{type = 'cancel'}):tag( 'item-not-found',{xmlns = 'urn:ietf:params:xml:ns:xmpp-stanzas'} ) @@ -342,7 +342,7 @@ end -- construct the response local result = st.stanza('query',{ - xmlns = 'http://jabber.org/protocol/disco#items', + xmlns = xmlns_disco_items, node = query.attr.node }) for key,item in pairs(items) do