24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-18 22:15:20 +02:00

Generate HTTP Upload form using xdata codec

This commit is contained in:
Evgeniy Khramtsov 2018-06-27 13:29:38 +03:00
parent 87357c700f
commit af8c6d2428
2 changed files with 4 additions and 10 deletions

View File

@ -25,7 +25,7 @@
{fast_tls, ".*", {git, "https://github.com/processone/fast_tls", {tag, "1.0.22"}}},
{stringprep, ".*", {git, "https://github.com/processone/stringprep", {tag, "1.0.11"}}},
{fast_xml, ".*", {git, "https://github.com/processone/fast_xml", {tag, "1.1.30"}}},
{xmpp, ".*", {git, "https://github.com/processone/xmpp", "cb39f8b"}},
{xmpp, ".*", {git, "https://github.com/processone/xmpp", "7279938"}},
{fast_yaml, ".*", {git, "https://github.com/processone/fast_yaml", {tag, "1.0.14"}}},
{jiffy, ".*", {git, "https://github.com/davisp/jiffy", {tag, "0.14.8"}}},
{p1_oauth2, ".*", {git, "https://github.com/processone/p1_oauth2", {tag, "0.6.3"}}},

View File

@ -689,17 +689,11 @@ iq_disco_info(Host, Lang, Name, AddInfo) ->
infinity ->
AddInfo;
MaxSize ->
MaxSizeStr = integer_to_binary(MaxSize),
XData = lists:map(
fun(NS) ->
Fields = [#xdata_field{
type = hidden,
var = <<"FORM_TYPE">>,
values = [NS]},
#xdata_field{
var = <<"max-file-size">>,
values = [MaxSizeStr]}],
#xdata{type = result, fields = Fields}
Fs = http_upload:encode(
[{'max-file-size', MaxSize}], NS, Lang),
#xdata{type = result, fields = Fs}
end, [?NS_HTTP_UPLOAD, ?NS_HTTP_UPLOAD_0]),
XData ++ AddInfo
end,