mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-26 17:38:45 +01:00
Merge pull request #547 from weiss/fix-account-jid-disco
Fix service discovery handling for account JIDs
This commit is contained in:
commit
6f99775115
@ -352,19 +352,19 @@ get_sm_items(empty, From, To, _Node, _Lang) ->
|
||||
_ -> {error, ?ERR_NOT_ALLOWED}
|
||||
end.
|
||||
|
||||
is_presence_subscribed(#jid{luser = User,
|
||||
lserver = Server},
|
||||
#jid{luser = LUser, lserver = LServer}) ->
|
||||
lists:any(fun (#roster{jid = {TUser, TServer, _},
|
||||
subscription = S}) ->
|
||||
if LUser == TUser, LServer == TServer, S /= none ->
|
||||
is_presence_subscribed(#jid{luser = User, lserver = Server},
|
||||
#jid{luser = User, lserver = Server}) -> true;
|
||||
is_presence_subscribed(#jid{luser = FromUser, lserver = FromServer},
|
||||
#jid{luser = ToUser, lserver = ToServer}) ->
|
||||
lists:any(fun (#roster{jid = {SubUser, SubServer, _}, subscription = Sub})
|
||||
when FromUser == SubUser, FromServer == SubServer,
|
||||
Sub /= none ->
|
||||
true;
|
||||
true -> false
|
||||
end
|
||||
(_RosterEntry) ->
|
||||
false
|
||||
end,
|
||||
ejabberd_hooks:run_fold(roster_get, Server, [],
|
||||
[{User, Server}]))
|
||||
orelse User == LUser andalso Server == LServer.
|
||||
ejabberd_hooks:run_fold(roster_get, ToServer, [],
|
||||
[{ToUser, ToServer}])).
|
||||
|
||||
process_sm_iq_info(From, To,
|
||||
#iq{type = Type, lang = Lang, sub_el = SubEl} = IQ) ->
|
||||
|
Loading…
Reference in New Issue
Block a user