mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-28 16:34:13 +01:00
mod_disco: Omit 'roster_get' call if possible
As a small optimization, avoid running the 'roster_get' hook in the (common) case where a client requests service discovery information for its own bare JID.
This commit is contained in:
parent
50f35f1b07
commit
0edba763fb
@ -352,6 +352,9 @@ get_sm_items(empty, From, To, _Node, _Lang) ->
|
|||||||
_ -> {error, ?ERR_NOT_ALLOWED}
|
_ -> {error, ?ERR_NOT_ALLOWED}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
is_presence_subscribed(#jid{luser = User,
|
||||||
|
lserver = Server},
|
||||||
|
#jid{luser = User, lserver = Server}) -> true;
|
||||||
is_presence_subscribed(#jid{luser = User,
|
is_presence_subscribed(#jid{luser = User,
|
||||||
lserver = Server},
|
lserver = Server},
|
||||||
#jid{luser = LUser, lserver = LServer}) ->
|
#jid{luser = LUser, lserver = LServer}) ->
|
||||||
@ -363,8 +366,7 @@ is_presence_subscribed(#jid{luser = User,
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
ejabberd_hooks:run_fold(roster_get, LServer, [],
|
ejabberd_hooks:run_fold(roster_get, LServer, [],
|
||||||
[{LUser, LServer}]))
|
[{LUser, LServer}])).
|
||||||
orelse User == LUser andalso Server == LServer.
|
|
||||||
|
|
||||||
process_sm_iq_info(From, To,
|
process_sm_iq_info(From, To,
|
||||||
#iq{type = Type, lang = Lang, sub_el = SubEl} = IQ) ->
|
#iq{type = Type, lang = Lang, sub_el = SubEl} = IQ) ->
|
||||||
|
Loading…
Reference in New Issue
Block a user