Skip to content

Commit 44fa357

Browse files
committed
Result of running "make doap format options"
1 parent 354e492 commit 44fa357

File tree

4 files changed

+36
-25
lines changed

4 files changed

+36
-25
lines changed

ejabberd.doap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@
770770
<xmpp:version>1.0.1</xmpp:version>
771771
<xmpp:since>23.10</xmpp:since>
772772
<xmpp:status>complete</xmpp:status>
773-
<xmpp:note>mod_muc_occupantid</xmpp:note>
773+
<xmpp:note>mod_muc</xmpp:note>
774774
</xmpp:SupportedXep>
775775
</implements>
776776
<implements>

src/mod_invites.erl

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ mod_opt_type(access_create_account) ->
291291
mod_opt_type(db_type) ->
292292
econf:db_type(?MODULE);
293293
mod_opt_type(landing_page) ->
294-
econf:either(econf:enum([none, auto]), econf:binary());
294+
econf:either(
295+
econf:enum([none, auto]), econf:binary());
295296
mod_opt_type(max_invites) ->
296297
econf:pos_int(infinity);
297298
mod_opt_type(site_name) ->
@@ -398,8 +399,7 @@ cleanup_expired() ->
398399
expire_tokens(User0, Server0) ->
399400
User = jid:nodeprep(User0),
400401
Server = jid:nameprep(Server0),
401-
pretty_format_command_result(
402-
try_db_call(Server, expire_tokens, [User, Server])).
402+
pretty_format_command_result(try_db_call(Server, expire_tokens, [User, Server])).
403403

404404
-spec generate_invite(binary()) -> binary() | {error, any()}.
405405
generate_invite(Host) ->
@@ -410,9 +410,11 @@ generate_invite(AccountName, Host) ->
410410
pretty_format_command_result(gen_invite(AccountName, Host)).
411411

412412
-ifdef(TEST).
413+
413414
-spec gen_invite(binary()) -> binary() | {error, any()}.
414415
gen_invite(Host) ->
415416
gen_invite(<<>>, Host).
417+
416418
-endif.
417419

418420
-spec gen_invite(binary(), binary()) -> binary() | {error, any()}.
@@ -428,27 +430,28 @@ gen_invite(AccountName, Host0) ->
428430
end.
429431

430432
list_invites(Host) ->
431-
Res =
432-
maybe
433-
{ok, Invites} ?= try_db_call(Host, list_invites, [Host]),
434-
[format_invite(Host, Invite) || Invite <- Invites]
435-
end,
433+
Res = maybe
434+
{ok, Invites} ?= try_db_call(Host, list_invites, [Host]),
435+
[format_invite(Host, Invite) || Invite <- Invites]
436+
end,
436437
pretty_format_command_result(Res).
437438

438-
format_invite(Host, #invite_token{token = TO,
439+
format_invite(Host,
440+
#invite_token{token = TO,
439441
inviter = {IU, IS},
440442
invitee = IE,
441443
created_at = CA,
442444
expires = Exp,
443445
type = TY,
444-
account_name = AN} = Invite) ->
446+
account_name = AN} =
447+
Invite) ->
445448
{TO,
446449
is_token_valid(Host, TO),
447450
encode_datetime(CA),
448451
encode_datetime(Exp),
449452
TY,
450453
jid:encode(
451-
jid:make(IU, IS)),
454+
jid:make(IU, IS)),
452455
IE,
453456
AN,
454457
token_uri(Invite),
@@ -916,21 +919,26 @@ maybe_add_ibr_allowed(User, Host) ->
916919
landing_page(Host, Invite) ->
917920
mod_invites_http:landing_page(Host, Invite).
918921

919-
-spec db_call(binary(), atom(), list(any())) -> any().
922+
-spec db_call(binary(), atom(), [any()]) -> any().
920923
db_call(Host, Fun, Args) ->
921924
Mod = gen_mod:db_mod(Host, ?MODULE),
922925
apply(Mod, Fun, Args).
923926

924927
%% father forgive me
925-
lift({error, _R} = E) -> E;
926-
lift({ok, _V} = R) -> R;
927-
lift(Res) -> {ok, Res}.
928-
929-
-spec try_db_call(Host :: binary(), Fun :: atom(), Args :: list(any())) -> {ok, any()} | {error, any()}.
928+
lift({error, _R} = E) ->
929+
E;
930+
lift({ok, _V} = R) ->
931+
R;
932+
lift(Res) ->
933+
{ok, Res}.
934+
935+
-spec try_db_call(Host :: binary(), Fun :: atom(), Args :: [any()]) ->
936+
{ok, any()} | {error, any()}.
930937
try_db_call(Host, Fun, Args) ->
931-
try lift(db_call(Host, Fun, Args))
938+
try
939+
lift(db_call(Host, Fun, Args))
932940
catch
933-
error:{error, _Reason} = Error->
941+
error:({error, _Reason} = Error) ->
934942
Error;
935943
error:Error ->
936944
{error, Error}
@@ -1039,7 +1047,9 @@ send_presence(From, To, Type) ->
10391047
ejabberd_router:route(Presence).
10401048

10411049
pretty_format_command_result({error, {module_not_loaded, ?MODULE, Host}}) ->
1042-
{error, lists:flatten(io_lib:format("Virtual host not known: ~s", [binary_to_list(Host)]))};
1050+
{error,
1051+
lists:flatten(
1052+
io_lib:format("Virtual host not known: ~s", [binary_to_list(Host)]))};
10431053
pretty_format_command_result({error, host_unknown}) ->
10441054
{error, "Virtual host not known"};
10451055
pretty_format_command_result({error, user_exists}) ->

src/mod_invites_opt.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ db_type(Opts) when is_map(Opts) ->
2323
db_type(Host) ->
2424
gen_mod:get_module_opt(Host, mod_invites, db_type).
2525

26-
-spec landing_page(gen_mod:opts() | global | binary()) -> 'none' | binary().
26+
-spec landing_page(gen_mod:opts() | global | binary()) -> 'auto' | 'none' | binary().
2727
landing_page(Opts) when is_map(Opts) ->
2828
gen_mod:get_opt(landing_page, Opts);
2929
landing_page(Host) ->

src/mod_muc_room.erl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5395,9 +5395,10 @@ add_presence_hats(JID, Pres, StateData) ->
53955395
false ->
53965396
false;
53975397
{URI, Title, Hue} ->
5398-
{true, #muc_hat{uri = URI,
5399-
title = Title,
5400-
hue = Hue}}
5398+
{true,
5399+
#muc_hat{uri = URI,
5400+
title = Title,
5401+
hue = Hue}}
54015402
end
54025403
end,
54035404
UserHats),

0 commit comments

Comments
 (0)