mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-26 17:38:45 +01:00
Don't check packets sent to self
This commit is contained in:
parent
9a11db91f9
commit
644873dae9
@ -190,6 +190,8 @@ maybe_adjust_from(#message{} = Msg) ->
|
|||||||
need_check(Pkt) ->
|
need_check(Pkt) ->
|
||||||
To = xmpp:get_to(Pkt),
|
To = xmpp:get_to(Pkt),
|
||||||
From = xmpp:get_from(Pkt),
|
From = xmpp:get_from(Pkt),
|
||||||
|
IsSelf = To#jid.luser == From#jid.luser andalso
|
||||||
|
To#jid.lserver == From#jid.lserver,
|
||||||
LServer = To#jid.lserver,
|
LServer = To#jid.lserver,
|
||||||
IsEmpty = case Pkt of
|
IsEmpty = case Pkt of
|
||||||
#message{body = [], subject = []} ->
|
#message{body = [], subject = []} ->
|
||||||
@ -199,7 +201,8 @@ need_check(Pkt) ->
|
|||||||
end,
|
end,
|
||||||
AllowLocalUsers = gen_mod:get_module_opt(LServer, ?MODULE, allow_local_users),
|
AllowLocalUsers = gen_mod:get_module_opt(LServer, ?MODULE, allow_local_users),
|
||||||
Access = gen_mod:get_module_opt(LServer, ?MODULE, access),
|
Access = gen_mod:get_module_opt(LServer, ?MODULE, access),
|
||||||
not (IsEmpty orelse acl:match_rule(LServer, Access, From) == allow
|
not (IsSelf orelse IsEmpty
|
||||||
|
orelse acl:match_rule(LServer, Access, From) == allow
|
||||||
orelse ((AllowLocalUsers orelse From#jid.luser == <<"">>)
|
orelse ((AllowLocalUsers orelse From#jid.luser == <<"">>)
|
||||||
andalso ejabberd_router:is_my_host(From#jid.lserver))).
|
andalso ejabberd_router:is_my_host(From#jid.lserver))).
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user