diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2016-07-31 14:51:16 +0300 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2016-07-31 14:51:16 +0300 |
commit | c0272ae7669b548a3cd568229748377feba71e57 (patch) | |
tree | 65745c1449d1e2e0497864779fb8301535bb3ebc /tools | |
parent | e258462b6b811baa2500a2d1c843ecbecf9382a7 (diff) |
Rewrite mod_stats to use XML generator
Diffstat (limited to 'tools')
-rw-r--r-- | tools/xmpp_codec.spec | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/xmpp_codec.spec b/tools/xmpp_codec.spec index 964b631c2..a50b58b59 100644 --- a/tools/xmpp_codec.spec +++ b/tools/xmpp_codec.spec @@ -289,7 +289,8 @@ -xml(stat_error, #elem{name = <<"error">>, xmlns = <<"http://jabber.org/protocol/stats">>, - result = {'$code', '$cdata'}, + result = {stat_error, '$code', '$reason'}, + cdata = #cdata{default = <<"">>, label = '$reason'}, attrs = [#attr{name = <<"code">>, required = true, enc = {enc_int, []}, @@ -301,17 +302,17 @@ result = {stat, '$name', '$units', '$value', '$error'}, attrs = [#attr{name = <<"name">>, required = true}, - #attr{name = <<"units">>}, - #attr{name = <<"value">>}], - refs = [#ref{name = stat_error, - label = '$error'}]}). + #attr{name = <<"units">>, default = <<"">>}, + #attr{name = <<"value">>, default = <<"">>}], + refs = [#ref{name = stat_error, label = '$error', + min = 0, max = 1}]}). -xml(stats, #elem{name = <<"query">>, xmlns = <<"http://jabber.org/protocol/stats">>, - result = {stats, '$stat'}, - refs = [#ref{name = stat, - label = '$stat'}]}). + result = {stats, '$list', '$node'}, + attrs = [#attr{name = <<"node">>, default = <<"">>}], + refs = [#ref{name = stat, label = '$list'}]}). -xml(iq, #elem{name = <<"iq">>, |