25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01: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"}}}, {fast_tls, ".*", {git, "https://github.com/processone/fast_tls", {tag, "1.0.22"}}},
{stringprep, ".*", {git, "https://github.com/processone/stringprep", {tag, "1.0.11"}}}, {stringprep, ".*", {git, "https://github.com/processone/stringprep", {tag, "1.0.11"}}},
{fast_xml, ".*", {git, "https://github.com/processone/fast_xml", {tag, "1.1.30"}}}, {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"}}}, {fast_yaml, ".*", {git, "https://github.com/processone/fast_yaml", {tag, "1.0.14"}}},
{jiffy, ".*", {git, "https://github.com/davisp/jiffy", {tag, "0.14.8"}}}, {jiffy, ".*", {git, "https://github.com/davisp/jiffy", {tag, "0.14.8"}}},
{p1_oauth2, ".*", {git, "https://github.com/processone/p1_oauth2", {tag, "0.6.3"}}}, {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 -> infinity ->
AddInfo; AddInfo;
MaxSize -> MaxSize ->
MaxSizeStr = integer_to_binary(MaxSize),
XData = lists:map( XData = lists:map(
fun(NS) -> fun(NS) ->
Fields = [#xdata_field{ Fs = http_upload:encode(
type = hidden, [{'max-file-size', MaxSize}], NS, Lang),
var = <<"FORM_TYPE">>, #xdata{type = result, fields = Fs}
values = [NS]},
#xdata_field{
var = <<"max-file-size">>,
values = [MaxSizeStr]}],
#xdata{type = result, fields = Fields}
end, [?NS_HTTP_UPLOAD, ?NS_HTTP_UPLOAD_0]), end, [?NS_HTTP_UPLOAD, ?NS_HTTP_UPLOAD_0]),
XData ++ AddInfo XData ++ AddInfo
end, end,