Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/processone/ejabberd.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>2016-07-26 09:52:29 +0300
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>2016-07-26 09:52:29 +0300
commitda310a517396bee93e96da9a3717230938064494 (patch)
tree31ca3d9b033a8691c1f42a796d8f73bbcf7982ba /tools
parent179fcd9521ef8db4626ca110ba80c502d810c814 (diff)
Rewrite mod_adhoc and mod_announce to use XML generator
Diffstat (limited to 'tools')
-rw-r--r--tools/xmpp_codec.spec56
1 files changed, 56 insertions, 0 deletions
diff --git a/tools/xmpp_codec.spec b/tools/xmpp_codec.spec
index fdf16ed37..0e0145f72 100644
--- a/tools/xmpp_codec.spec
+++ b/tools/xmpp_codec.spec
@@ -2821,6 +2821,62 @@
result = {client_id, '$id'},
attrs = [#attr{name = <<"id">>, required = true}]}).
+-xml(adhoc_command_prev,
+ #elem{name = <<"prev">>,
+ xmlns = <<"http://jabber.org/protocol/commands">>,
+ result = true}).
+-xml(adhoc_command_next,
+ #elem{name = <<"next">>,
+ xmlns = <<"http://jabber.org/protocol/commands">>,
+ result = true}).
+-xml(adhoc_command_complete,
+ #elem{name = <<"complete">>,
+ xmlns = <<"http://jabber.org/protocol/commands">>,
+ result = true}).
+
+-xml(adhoc_command_actions,
+ #elem{name = <<"actions">>,
+ xmlns = <<"http://jabber.org/protocol/commands">>,
+ result = {adhoc_actions, '$execute', '$prev', '$next', '$complete'},
+ attrs = [#attr{name = <<"execute">>,
+ dec = {dec_enum, [[complete, next, prev]]},
+ enc = {enc_enum, []}}],
+ refs = [#ref{name = adhoc_command_prev, min = 0, max = 1,
+ default = false, label = '$prev'},
+ #ref{name = adhoc_command_next, min = 0, max = 1,
+ default = false, label = '$next'},
+ #ref{name = adhoc_command_complete, min = 0, max = 1,
+ default = false, label = '$complete'}]}).
+
+-xml(adhoc_command_notes,
+ #elem{name = <<"note">>,
+ xmlns = <<"http://jabber.org/protocol/commands">>,
+ result = {adhoc_note, '$type', '$data'},
+ attrs = [#attr{name = <<"type">>, default = info,
+ dec = {dec_enum, [[info, warn, error]]},
+ enc = {enc_enum, []}}],
+ cdata = #cdata{default = <<"">>, label = '$data'}}).
+
+-xml(adhoc_command,
+ #elem{name = <<"command">>,
+ xmlns = <<"http://jabber.org/protocol/commands">>,
+ result = {adhoc_command, '$node', '$action', '$sid',
+ '$status', '$lang', '$actions', '$notes', '$xdata'},
+ attrs = [#attr{name = <<"node">>, required = true},
+ #attr{name = <<"xml:lang">>, label = '$lang'},
+ #attr{name = <<"sessionid">>, label = '$sid'},
+ #attr{name = <<"status">>,
+ dec = {dec_enum, [[canceled, completed, executing]]},
+ enc = {enc_enum, []}},
+ #attr{name = <<"action">>, default = execute,
+ dec = {dec_enum, [[cancel, complete,
+ execute, next, prev]]},
+ enc = {enc_enum, []}}],
+ refs = [#ref{name = adhoc_command_actions, min = 0, max = 1,
+ label = '$actions'},
+ #ref{name = xdata, min = 0, max = 1},
+ #ref{name = adhoc_command_notes, label = '$notes'}]}).
+
dec_tzo(Val) ->
[H1, M1] = str:tokens(Val, <<":">>),
H = jlib:binary_to_integer(H1),