From 50f35f1b0747ba9616392b9f8011b68cda7bfa5b Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sun, 26 Apr 2015 16:22:09 +0200 Subject: [PATCH] Fix service disco handling for bare account JIDs Don't swap the sending and receiving JIDs while checking whether the client that requested service discovery information for a bare account JID is a subscribed contact. --- src/mod_disco.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mod_disco.erl b/src/mod_disco.erl index 40f0f8e06..4231df68d 100644 --- a/src/mod_disco.erl +++ b/src/mod_disco.erl @@ -357,13 +357,13 @@ is_presence_subscribed(#jid{luser = User, #jid{luser = LUser, lserver = LServer}) -> lists:any(fun (#roster{jid = {TUser, TServer, _}, subscription = S}) -> - if LUser == TUser, LServer == TServer, S /= none -> + if User == TUser, Server == TServer, S /= none -> true; true -> false end end, - ejabberd_hooks:run_fold(roster_get, Server, [], - [{User, Server}])) + ejabberd_hooks:run_fold(roster_get, LServer, [], + [{LUser, LServer}])) orelse User == LUser andalso Server == LServer. process_sm_iq_info(From, To,