1
0
Fork 0
mirror of https://github.com/processone/ejabberd synced 2025-10-03 09:49:18 +02:00

Use new xdata compiler API

This commit is contained in:
Evgeniy Khramtsov 2017-03-20 09:57:11 +03:00
parent 06f42bc749
commit f3ecba0445
5 changed files with 10 additions and 14 deletions

View file

@ -24,7 +24,7 @@
{fast_tls, ".*", {git, "https://github.com/processone/fast_tls", "afdd07811e0e6eff444c035ffeb2aa9efb4dbe6d"}}, {fast_tls, ".*", {git, "https://github.com/processone/fast_tls", "afdd07811e0e6eff444c035ffeb2aa9efb4dbe6d"}},
{stringprep, ".*", {git, "https://github.com/processone/stringprep", {tag, "1.0.7"}}}, {stringprep, ".*", {git, "https://github.com/processone/stringprep", {tag, "1.0.7"}}},
{fast_xml, ".*", {git, "https://github.com/processone/fast_xml", {tag, "1.1.21"}}}, {fast_xml, ".*", {git, "https://github.com/processone/fast_xml", {tag, "1.1.21"}}},
{xmpp, ".*", {git, "https://github.com/processone/xmpp", "cfb5c11280fdd82f8370d9322bbcb3255b743c76"}}, {xmpp, ".*", {git, "https://github.com/processone/xmpp", "50f2d85"}},
{stun, ".*", {git, "https://github.com/processone/stun", {tag, "1.0.9"}}}, {stun, ".*", {git, "https://github.com/processone/stun", {tag, "1.0.9"}}},
{esip, ".*", {git, "https://github.com/processone/esip", {tag, "1.0.10"}}}, {esip, ".*", {git, "https://github.com/processone/esip", {tag, "1.0.10"}}},
{fast_yaml, ".*", {git, "https://github.com/processone/fast_yaml", {tag, "1.0.8"}}}, {fast_yaml, ".*", {git, "https://github.com/processone/fast_yaml", {tag, "1.0.8"}}},

View file

@ -772,9 +772,7 @@ iq_get_register_info(ServerHost, Host, From, Lang) ->
Title = <<(translate:translate( Title = <<(translate:translate(
Lang, <<"Nickname Registration at ">>))/binary, Host/binary>>, Lang, <<"Nickname Registration at ">>))/binary, Host/binary>>,
Inst = translate:translate(Lang, <<"Enter nickname you want to register">>), Inst = translate:translate(Lang, <<"Enter nickname you want to register">>),
Fields = muc_register:encode( Fields = muc_register:encode([{roomnick, Nick}], Lang),
[{roomnick, Nick}],
fun(T) -> translate:translate(Lang, T) end),
X = #xdata{type = form, title = Title, X = #xdata{type = form, title = Title,
instructions = [Inst], fields = Fields}, instructions = [Inst], fields = Fields},
#register{nick = Nick, #register{nick = Nick,

View file

@ -3198,8 +3198,7 @@ get_config(Lang, StateData, From) ->
Fs, Fs,
[StateData, From, Lang]), [StateData, From, Lang]),
#xdata{type = form, title = Title, #xdata{type = form, title = Title,
fields = muc_roomconfig:encode( fields = muc_roomconfig:encode(Fields, Lang)}.
Fields, fun(T) -> translate:translate(Lang, T) end)}.
-spec set_config(muc_roomconfig:result(), state(), binary()) -> -spec set_config(muc_roomconfig:result(), state(), binary()) ->
{error, stanza_error()} | {result, undefined, state()}. {error, stanza_error()} | {result, undefined, state()}.
@ -3613,8 +3612,7 @@ iq_disco_info_extras(Lang, StateData) ->
Fs = [{description, (StateData#state.config)#config.description}, Fs = [{description, (StateData#state.config)#config.description},
{occupants, ?DICT:size(StateData#state.users)}], {occupants, ?DICT:size(StateData#state.users)}],
#xdata{type = result, #xdata{type = result,
fields = muc_roominfo:encode( fields = muc_roominfo:encode(Fs, Lang)}.
Fs, fun(T) -> translate:translate(Lang, T) end)}.
-spec process_iq_disco_items(jid(), iq(), state()) -> -spec process_iq_disco_items(jid(), iq(), state()) ->
{error, stanza_error()} | {result, disco_items()}. {error, stanza_error()} | {result, disco_items()}.
@ -3835,7 +3833,7 @@ prepare_request_form(Requester, Nick, Lang) ->
{jid, Requester}, {jid, Requester},
{roomnick, Nick}, {roomnick, Nick},
{request_allow, false}], {request_allow, false}],
fun(T) -> translate:translate(Lang, T) end), Lang),
#message{type = normal, #message{type = normal,
sub_els = [#xdata{type = form, sub_els = [#xdata{type = form,
title = Title, title = Title,

View file

@ -319,7 +319,7 @@ get_info(_Acc, #jid{luser = U, lserver = S} = JID,
[#xdata{type = result, [#xdata{type = result,
fields = flex_offline:encode( fields = flex_offline:encode(
[{number_of_messages, count_offline_messages(U, S)}], [{number_of_messages, count_offline_messages(U, S)}],
fun(T) -> translate:translate(Lang, T) end)}]; Lang)}];
get_info(Acc, _From, _To, _Node, _Lang) -> get_info(Acc, _From, _To, _Node, _Lang) ->
Acc. Acc.

View file

@ -1371,7 +1371,7 @@ adhoc_request(_Host, _ServerHost, _Owner, Other, _Access, _Plugins) ->
-spec send_pending_node_form(binary(), jid(), binary(), -spec send_pending_node_form(binary(), jid(), binary(),
[binary()]) -> adhoc_command() | {error, stanza_error()}. [binary()]) -> adhoc_command() | {error, stanza_error()}.
send_pending_node_form(Host, Owner, _Lang, Plugins) -> send_pending_node_form(Host, Owner, Lang, Plugins) ->
Filter = fun (Type) -> Filter = fun (Type) ->
lists:member(<<"get-pending">>, plugin_features(Host, Type)) lists:member(<<"get-pending">>, plugin_features(Host, Type))
end, end,
@ -1385,7 +1385,7 @@ send_pending_node_form(Host, Owner, _Lang, Plugins) ->
{ok, Nodes} -> {ok, Nodes} ->
XForm = #xdata{type = form, XForm = #xdata{type = form,
fields = pubsub_get_pending:encode( fields = pubsub_get_pending:encode(
[{node, Nodes}])}, [{node, Nodes}], Lang)},
#adhoc_command{status = executing, action = execute, #adhoc_command{status = executing, action = execute,
xdata = XForm}; xdata = XForm};
Err -> Err ->
@ -1454,7 +1454,7 @@ send_authorization_request(#pubsub_node{nodeid = {Host, Node},
[{node, Node}, [{node, Node},
{subscriber_jid, Subscriber}, {subscriber_jid, Subscriber},
{allow, false}], {allow, false}],
fun(T) -> translate:translate(Lang, T) end), Lang),
X = #xdata{type = form, X = #xdata{type = form,
title = translate:translate( title = translate:translate(
Lang, <<"PubSub subscriber request">>), Lang, <<"PubSub subscriber request">>),
@ -3281,7 +3281,7 @@ get_configure_xfields(_Type, Options, Lang, Groups) ->
(Opt) -> (Opt) ->
Opt Opt
end, Options), end, Options),
fun(Txt) -> translate:translate(Lang, Txt) end). Lang).
%%<p>There are several reasons why the node configuration request might fail:</p> %%<p>There are several reasons why the node configuration request might fail:</p>
%%<ul> %%<ul>