]> granicus.if.org Git - ejabberd/commitdiff
Use new xdata compiler API
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Mon, 20 Mar 2017 06:57:11 +0000 (09:57 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Mon, 20 Mar 2017 06:57:11 +0000 (09:57 +0300)
rebar.config
src/mod_muc.erl
src/mod_muc_room.erl
src/mod_offline.erl
src/mod_pubsub.erl

index a80fefe074792b6926d310fc1eb417af0e3ab686..d2e459f86c2d232be85972c614ff0d013c31e2fd 100644 (file)
@@ -24,7 +24,7 @@
         {fast_tls, ".*", {git, "https://github.com/processone/fast_tls", "afdd07811e0e6eff444c035ffeb2aa9efb4dbe6d"}},
         {stringprep, ".*", {git, "https://github.com/processone/stringprep", {tag, "1.0.7"}}},
         {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"}}},
         {esip, ".*", {git, "https://github.com/processone/esip", {tag, "1.0.10"}}},
         {fast_yaml, ".*", {git, "https://github.com/processone/fast_yaml", {tag, "1.0.8"}}},
index f9488cf9a8af7df668a1020def0a63401761040a..65e61694fae21c8d6a7f5414d1d4e2e103d52d03 100644 (file)
@@ -772,9 +772,7 @@ iq_get_register_info(ServerHost, Host, From, Lang) ->
     Title = <<(translate:translate(
                 Lang, <<"Nickname Registration at ">>))/binary, Host/binary>>,
     Inst = translate:translate(Lang, <<"Enter nickname you want to register">>),
-    Fields = muc_register:encode(
-              [{roomnick, Nick}],
-              fun(T) -> translate:translate(Lang, T) end),
+    Fields = muc_register:encode([{roomnick, Nick}], Lang),
     X = #xdata{type = form, title = Title,
               instructions = [Inst], fields = Fields},
     #register{nick = Nick,
index 8ab14a92beb22e46f66fe6d7be4b2b62d7bea3a5..dc30cc898c31aa538c1d66e5dcbbc54d0ffeea28 100644 (file)
@@ -3198,8 +3198,7 @@ get_config(Lang, StateData, From) ->
                                     Fs,
                                     [StateData, From, Lang]),
     #xdata{type = form, title = Title,
-          fields = muc_roomconfig:encode(
-                     Fields, fun(T) -> translate:translate(Lang, T) end)}.
+          fields = muc_roomconfig:encode(Fields, Lang)}.
 
 -spec set_config(muc_roomconfig:result(), state(), binary()) ->
                        {error, stanza_error()} | {result, undefined, state()}.
@@ -3613,8 +3612,7 @@ iq_disco_info_extras(Lang, StateData) ->
     Fs = [{description, (StateData#state.config)#config.description},
          {occupants, ?DICT:size(StateData#state.users)}],
     #xdata{type = result,
-          fields = muc_roominfo:encode(
-                     Fs, fun(T) -> translate:translate(Lang, T) end)}.
+          fields = muc_roominfo:encode(Fs, Lang)}.
 
 -spec process_iq_disco_items(jid(), iq(), state()) ->
                                    {error, stanza_error()} | {result, disco_items()}.
@@ -3835,7 +3833,7 @@ prepare_request_form(Requester, Nick, Lang) ->
                             {jid, Requester},
                             {roomnick, Nick},
                             {request_allow, false}],
-                           fun(T) -> translate:translate(Lang, T) end),
+                           Lang),
     #message{type = normal,
             sub_els = [#xdata{type = form,
                               title = Title,
index ba304f8219566a791da2c1713edb2349b9fca1cb..db2efb040b9d752fc8c13abc3821c4ebf878e4c0 100644 (file)
@@ -319,7 +319,7 @@ get_info(_Acc, #jid{luser = U, lserver = S} = JID,
     [#xdata{type = result,
            fields = flex_offline:encode(
                       [{number_of_messages, count_offline_messages(U, S)}],
-                      fun(T) -> translate:translate(Lang, T) end)}];
+                      Lang)}];
 get_info(Acc, _From, _To, _Node, _Lang) ->
     Acc.
 
index 4ea8400115ce9fa33680acb5a8508d7d7a06a97a..a0ac8643ef46e86ea0fdd4e0c5a46d1d19713f6e 100644 (file)
@@ -1371,7 +1371,7 @@ adhoc_request(_Host, _ServerHost, _Owner, Other, _Access, _Plugins) ->
 
 -spec send_pending_node_form(binary(), jid(), binary(),
                             [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) ->
            lists:member(<<"get-pending">>, plugin_features(Host, Type))
     end,
@@ -1385,7 +1385,7 @@ send_pending_node_form(Host, Owner, _Lang, Plugins) ->
                {ok, Nodes} ->
                    XForm = #xdata{type = form,
                                   fields = pubsub_get_pending:encode(
-                                             [{node, Nodes}])},
+                                             [{node, Nodes}], Lang)},
                    #adhoc_command{status = executing, action = execute,
                                   xdata = XForm};
                Err ->
@@ -1454,7 +1454,7 @@ send_authorization_request(#pubsub_node{nodeid = {Host, Node},
           [{node, Node},
            {subscriber_jid, Subscriber},
            {allow, false}],
-          fun(T) -> translate:translate(Lang, T) end),
+          Lang),
     X = #xdata{type = form,
               title = translate:translate(
                         Lang, <<"PubSub subscriber request">>),
@@ -3281,7 +3281,7 @@ get_configure_xfields(_Type, Options, Lang, Groups) ->
           (Opt) ->
                Opt
        end, Options),
-      fun(Txt) -> translate:translate(Lang, Txt) end).
+      Lang).
 
 %%<p>There are several reasons why the node configuration request might fail:</p>
 %%<ul>