25
1
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:
badlop 2015-04-27 19:39:32 +02:00
commit 6f99775115

View File

@ -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) ->