From fd8e07af4789be362a61755ea47f216baeb64989 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Thu, 14 Jun 2018 14:00:47 +0300 Subject: Get rid of ejabberd.hrl header The header consisted of too many unrelated stuff and macros misuse. Some stuff is moved into scram.hrl and type_compat.hrl. All macros have been replaced with the corresponding function calls. TODO: probably type_compat.hrl is not even needed anymore since we support only Erlang >= OTP 17.5 --- src/pubsub_subscription_sql.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/pubsub_subscription_sql.erl') diff --git a/src/pubsub_subscription_sql.erl b/src/pubsub_subscription_sql.erl index 06ad73b2..2fcfb0f1 100644 --- a/src/pubsub_subscription_sql.erl +++ b/src/pubsub_subscription_sql.erl @@ -172,13 +172,13 @@ val_xfield(digest_frequency = Opt, [Val]) -> N when is_integer(N) -> N; _ -> Txt = {<<"Value of '~s' should be integer">>, [Opt]}, - {error, xmpp:err_not_acceptable(Txt, ?MYLANG)} + {error, xmpp:err_not_acceptable(Txt, ejabberd_config:get_mylang())} end; val_xfield(expire = Opt, [Val]) -> try xmpp_util:decode_timestamp(Val) catch _:{bad_timestamp, _} -> Txt = {<<"Value of '~s' should be datetime string">>, [Opt]}, - {error, xmpp:err_not_acceptable(Txt, ?MYLANG)} + {error, xmpp:err_not_acceptable(Txt, ejabberd_config:get_mylang())} end; val_xfield(include_body = Opt, [Val]) -> xopt_to_bool(Opt, Val); val_xfield(show_values, Vals) -> Vals; @@ -190,7 +190,7 @@ val_xfield(subscription_depth = Opt, [Depth]) -> N when is_integer(N) -> N; _ -> Txt = {<<"Value of '~s' should be integer">>, [Opt]}, - {error, xmpp:err_not_acceptable(Txt, ?MYLANG)} + {error, xmpp:err_not_acceptable(Txt, ejabberd_config:get_mylang())} end. %% Convert XForm booleans to Erlang booleans. @@ -200,7 +200,7 @@ xopt_to_bool(_, <<"false">>) -> false; xopt_to_bool(_, <<"true">>) -> true; xopt_to_bool(Option, _) -> Txt = {<<"Value of '~s' should be boolean">>, [Option]}, - {error, xmpp:err_not_acceptable(Txt, ?MYLANG)}. + {error, xmpp:err_not_acceptable(Txt, ejabberd_config:get_mylang())}. %% Return a field for an XForm for Key, with data filled in, if %% applicable, from Options. -- cgit v1.2.3