Comparison

mod_seclabels/mod_seclabels.lua @ 266:e7296274f48c

mod_seclabels: Advertise features in account disco#info, fixes interop with Swift
author Kim Alvefur <zash@zash.se>
date Sun, 07 Nov 2010 16:58:13 +0100
parent 252:8eae74a31acb
child 449:08ffbbdafeea
comparison
equal deleted inserted replaced
265:8cd2fab3135a 266:e7296274f48c
2 2
3 local xmlns_label = "urn:xmpp:sec-label:0"; 3 local xmlns_label = "urn:xmpp:sec-label:0";
4 local xmlns_label_catalog = "urn:xmpp:sec-label:catalog:0"; 4 local xmlns_label_catalog = "urn:xmpp:sec-label:catalog:0";
5 5
6 module:add_feature(xmlns_label); 6 module:add_feature(xmlns_label);
7
8 module:hook("account-disco-info", function(event)
9 local stanza = event.stanza;
10 stanza:tag('feature', {var=xmlns_label}):up();
11 stanza:tag('feature', {var=xmlns_label_catalog}):up();
12 end);
7 13
8 local labels = { 14 local labels = {
9 Classified = { 15 Classified = {
10 SECRET = { color = "black", bgcolor = "aqua", label = "THISISSECRET" }; 16 SECRET = { color = "black", bgcolor = "aqua", label = "THISISSECRET" };
11 PUBLIC = { label = "THISISPUBLIC" }; 17 PUBLIC = { label = "THISISPUBLIC" };