mirror of
https://github.com/processone/ejabberd.git
synced 2024-06-02 21:17:12 +02:00
Fix validator of mod_avatar
This commit is contained in:
parent
d85cf7780c
commit
377748b688
|
@ -22,7 +22,7 @@
|
||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
-module(mod_avatar).
|
-module(mod_avatar).
|
||||||
-behaviour(gen_mod).
|
-behaviour(gen_mod).
|
||||||
|
-dialyzer({no_return, mod_opt_type/1}).
|
||||||
-protocol({xep, 398, '0.2.0'}).
|
-protocol({xep, 398, '0.2.0'}).
|
||||||
|
|
||||||
%% gen_mod API
|
%% gen_mod API
|
||||||
|
@ -435,17 +435,15 @@ encode_mime_type(Type) ->
|
||||||
<<"image/", (atom_to_binary(Type, latin1))/binary>>.
|
<<"image/", (atom_to_binary(Type, latin1))/binary>>.
|
||||||
|
|
||||||
mod_opt_type(convert) ->
|
mod_opt_type(convert) ->
|
||||||
Formats = eimp:supported_formats(),
|
case eimp:supported_formats() of
|
||||||
econf:and_then(
|
[] ->
|
||||||
fun(_) when Formats == [] ->
|
fun(_) -> econf:fail(eimp_error) end;
|
||||||
econf:fail(eimp_error);
|
Formats ->
|
||||||
(V) ->
|
|
||||||
V
|
|
||||||
end,
|
|
||||||
econf:options(
|
econf:options(
|
||||||
maps:from_list(
|
maps:from_list(
|
||||||
[{Type, econf:enum(Formats)}
|
[{Type, econf:enum(Formats)}
|
||||||
|| Type <- [default|Formats]])));
|
|| Type <- [default|Formats]]))
|
||||||
|
end;
|
||||||
mod_opt_type(rate_limit) ->
|
mod_opt_type(rate_limit) ->
|
||||||
econf:pos_int().
|
econf:pos_int().
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user