mirror of
https://github.com/processone/ejabberd.git
synced 2024-06-16 22:05:29 +02:00
Fix formatting
This commit is contained in:
parent
c39ce133de
commit
9c37450fe4
|
@ -959,9 +959,7 @@ wait_for_sasl_response(closed, StateData) ->
|
||||||
{stop, normal, StateData}.
|
{stop, normal, StateData}.
|
||||||
|
|
||||||
resource_conflict_action(U, S, R) ->
|
resource_conflict_action(U, S, R) ->
|
||||||
OptionRaw = case ejabberd_sm:is_existing_resource(U, S,
|
OptionRaw = case ejabberd_sm:is_existing_resource(U, S, R) of
|
||||||
R)
|
|
||||||
of
|
|
||||||
true ->
|
true ->
|
||||||
ejabberd_config:get_option(
|
ejabberd_config:get_option(
|
||||||
{resource_conflict, S},
|
{resource_conflict, S},
|
||||||
|
@ -1082,7 +1080,7 @@ wait_for_session({xmlstreamelement, El}, StateData) ->
|
||||||
?INFO_MSG("(~w) Opened session for ~s",
|
?INFO_MSG("(~w) Opened session for ~s",
|
||||||
[NewStateData#state.socket,
|
[NewStateData#state.socket,
|
||||||
jlib:jid_to_string(JID)]),
|
jlib:jid_to_string(JID)]),
|
||||||
Res = jlib:make_result_iq_reply(El#xmlel{children = []}),
|
Res = jlib:make_result_iq_reply(El#xmlel{children = []}),
|
||||||
NewState = send_stanza(NewStateData, Res),
|
NewState = send_stanza(NewStateData, Res),
|
||||||
change_shaper(NewState, JID),
|
change_shaper(NewState, JID),
|
||||||
{Fs, Ts} = ejabberd_hooks:run_fold(
|
{Fs, Ts} = ejabberd_hooks:run_fold(
|
||||||
|
@ -1888,12 +1886,11 @@ new_id() -> randoms:get_string().
|
||||||
|
|
||||||
is_auth_packet(El) ->
|
is_auth_packet(El) ->
|
||||||
case jlib:iq_query_info(El) of
|
case jlib:iq_query_info(El) of
|
||||||
#iq{id = ID, type = Type, xmlns = ?NS_AUTH,
|
#iq{id = ID, type = Type, xmlns = ?NS_AUTH, sub_el = SubEl} ->
|
||||||
sub_el = SubEl} ->
|
#xmlel{children = Els} = SubEl,
|
||||||
#xmlel{children = Els} = SubEl,
|
{auth, ID, Type,
|
||||||
{auth, ID, Type,
|
get_auth_tags(Els, <<"">>, <<"">>, <<"">>, <<"">>)};
|
||||||
get_auth_tags(Els, <<"">>, <<"">>, <<"">>, <<"">>)};
|
_ -> false
|
||||||
_ -> false
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
is_stanza(#xmlel{name = Name, attrs = Attrs}) when Name == <<"message">>;
|
is_stanza(#xmlel{name = Name, attrs = Attrs}) when Name == <<"message">>;
|
||||||
|
@ -2216,18 +2213,16 @@ remove_element(E, Set) ->
|
||||||
|
|
||||||
roster_change(IJID, ISubscription, StateData) ->
|
roster_change(IJID, ISubscription, StateData) ->
|
||||||
LIJID = jlib:jid_tolower(IJID),
|
LIJID = jlib:jid_tolower(IJID),
|
||||||
IsFrom = (ISubscription == both) or
|
IsFrom = (ISubscription == both) or (ISubscription == from),
|
||||||
(ISubscription == from),
|
|
||||||
IsTo = (ISubscription == both) or (ISubscription == to),
|
IsTo = (ISubscription == both) or (ISubscription == to),
|
||||||
OldIsFrom = (?SETS):is_element(LIJID,
|
OldIsFrom = (?SETS):is_element(LIJID, StateData#state.pres_f),
|
||||||
StateData#state.pres_f),
|
FSet = if
|
||||||
FSet = if IsFrom ->
|
IsFrom -> (?SETS):add_element(LIJID, StateData#state.pres_f);
|
||||||
(?SETS):add_element(LIJID, StateData#state.pres_f);
|
not IsFrom -> remove_element(LIJID, StateData#state.pres_f)
|
||||||
true -> remove_element(LIJID, StateData#state.pres_f)
|
|
||||||
end,
|
end,
|
||||||
TSet = if IsTo ->
|
TSet = if
|
||||||
(?SETS):add_element(LIJID, StateData#state.pres_t);
|
IsTo -> (?SETS):add_element(LIJID, StateData#state.pres_t);
|
||||||
true -> remove_element(LIJID, StateData#state.pres_t)
|
not IsTo -> remove_element(LIJID, StateData#state.pres_t)
|
||||||
end,
|
end,
|
||||||
case StateData#state.pres_last of
|
case StateData#state.pres_last of
|
||||||
undefined ->
|
undefined ->
|
||||||
|
@ -2321,11 +2316,10 @@ process_privacy_iq(From, To,
|
||||||
NewStateData.
|
NewStateData.
|
||||||
|
|
||||||
resend_offline_messages(StateData) ->
|
resend_offline_messages(StateData) ->
|
||||||
case
|
case ejabberd_hooks:run_fold(resend_offline_messages_hook,
|
||||||
ejabberd_hooks:run_fold(resend_offline_messages_hook,
|
StateData#state.server, [],
|
||||||
StateData#state.server, [],
|
[StateData#state.user, StateData#state.server])
|
||||||
[StateData#state.user, StateData#state.server])
|
of
|
||||||
of
|
|
||||||
Rs -> %%when is_list(Rs) ->
|
Rs -> %%when is_list(Rs) ->
|
||||||
lists:foreach(fun ({route, From, To,
|
lists:foreach(fun ({route, From, To,
|
||||||
#xmlel{} = Packet}) ->
|
#xmlel{} = Packet}) ->
|
||||||
|
@ -2345,8 +2339,7 @@ resend_offline_messages(StateData) ->
|
||||||
end.
|
end.
|
||||||
|
|
||||||
resend_subscription_requests(#state{user = User,
|
resend_subscription_requests(#state{user = User,
|
||||||
server = Server} =
|
server = Server} = StateData) ->
|
||||||
StateData) ->
|
|
||||||
PendingSubscriptions =
|
PendingSubscriptions =
|
||||||
ejabberd_hooks:run_fold(resend_subscription_requests_hook,
|
ejabberd_hooks:run_fold(resend_subscription_requests_hook,
|
||||||
Server, [], [User, Server]),
|
Server, [], [User, Server]),
|
||||||
|
@ -2358,11 +2351,9 @@ resend_subscription_requests(#state{user = User,
|
||||||
|
|
||||||
get_showtag(undefined) -> <<"unavailable">>;
|
get_showtag(undefined) -> <<"unavailable">>;
|
||||||
get_showtag(Presence) ->
|
get_showtag(Presence) ->
|
||||||
case xml:get_path_s(Presence,
|
case xml:get_path_s(Presence, [{elem, <<"show">>}, cdata]) of
|
||||||
[{elem, <<"show">>}, cdata])
|
<<"">> -> <<"available">>;
|
||||||
of
|
ShowTag -> ShowTag
|
||||||
<<"">> -> <<"available">>;
|
|
||||||
ShowTag -> ShowTag
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
get_statustag(undefined) -> <<"">>;
|
get_statustag(undefined) -> <<"">>;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user