]> granicus.if.org Git - ejabberd/commitdiff
Fix service disco handling for bare account JIDs
authorHolger Weiss <holger@zedat.fu-berlin.de>
Sun, 26 Apr 2015 14:22:09 +0000 (16:22 +0200)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Sun, 26 Apr 2015 14:22:09 +0000 (16:22 +0200)
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

index 40f0f8e06017f897cfdae98311884ca8ca7e89e8..4231df68df127f8aa8689ba30e84a00827732ed4 100644 (file)
@@ -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,