mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-26 17:38:45 +01:00
Rename some keys and functions for clarity
This commit is contained in:
parent
52ded14b7f
commit
c102a45fac
@ -192,7 +192,7 @@ c2s_handle_recv(#{mgmt_state := MgmtState,
|
|||||||
<<"result">> -> State1;
|
<<"result">> -> State1;
|
||||||
<<"error">> -> State1;
|
<<"error">> -> State1;
|
||||||
_ ->
|
_ ->
|
||||||
State1#{mgmt_is_resent => false}
|
State1#{mgmt_force_enqueue => true}
|
||||||
end;
|
end;
|
||||||
true ->
|
true ->
|
||||||
State
|
State
|
||||||
@ -206,7 +206,7 @@ c2s_handle_send(#{mgmt_state := MgmtState, mod := Mod,
|
|||||||
IsStanza = xmpp:is_stanza(Pkt),
|
IsStanza = xmpp:is_stanza(Pkt),
|
||||||
case Pkt of
|
case Pkt of
|
||||||
_ when IsStanza ->
|
_ when IsStanza ->
|
||||||
case need_to_queue(State, Pkt) of
|
case need_to_enqueue(State, Pkt) of
|
||||||
{true, State1} ->
|
{true, State1} ->
|
||||||
case mgmt_queue_add(State1, Pkt) of
|
case mgmt_queue_add(State1, Pkt) of
|
||||||
#{mgmt_max_queue := exceeded} = State2 ->
|
#{mgmt_max_queue := exceeded} = State2 ->
|
||||||
@ -727,12 +727,12 @@ bounce_message_queue() ->
|
|||||||
ok
|
ok
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec need_to_queue(state(), xmlel() | stanza()) -> {boolean(), state()}.
|
-spec need_to_enqueue(state(), xmlel() | stanza()) -> {boolean(), state()}.
|
||||||
need_to_queue(State, Pkt) when ?is_stanza(Pkt) ->
|
need_to_enqueue(State, Pkt) when ?is_stanza(Pkt) ->
|
||||||
{not xmpp:get_meta(Pkt, mgmt_is_resent, false), State};
|
{not xmpp:get_meta(Pkt, mgmt_is_resent, false), State};
|
||||||
need_to_queue(#{mgmt_is_resent := false} = State, #xmlel{}) ->
|
need_to_enqueue(#{mgmt_force_enqueue := true} = State, #xmlel{}) ->
|
||||||
{true, maps:remove(mgmt_is_resent, State)};
|
{true, maps:remove(mgmt_is_resent, State)};
|
||||||
need_to_queue(State, _) ->
|
need_to_enqueue(State, _) ->
|
||||||
{false, State}.
|
{false, State}.
|
||||||
|
|
||||||
%%%===================================================================
|
%%%===================================================================
|
||||||
|
Loading…
Reference in New Issue
Block a user