]> granicus.if.org Git - ejabberd/commitdiff
Don't perform roster push for non-local contacts in mod_shared_roster
authorPaweł Chmielowski <pchmielowski@process-one.net>
Mon, 18 Feb 2019 11:37:29 +0000 (12:37 +0100)
committerPaweł Chmielowski <pchmielowski@process-one.net>
Mon, 18 Feb 2019 11:37:42 +0000 (12:37 +0100)
If group have member with jid from external server we tried to make
mod_roster sent roster push to it, and it sometimes didn't like to get
bogus data like that, so let's check if it's local user before doing this.

src/mod_shared_roster.erl

index ee1aa8cf0f4945cd128c21c4a4b428cfeaad080f..d80258db7f175a6c4a06f66e5dd19dc41ea3797a 100644 (file)
@@ -662,8 +662,13 @@ push_user_to_group(LUser, LServer, Group, Host,
                          when (U == LUser) and (S == LServer) ->
                          ok;
                      ({U, S}) ->
-                         push_roster_item(U, S, LUser, LServer, GroupName,
-                                          Subscription)
+                         case lists:member(S, ejabberd_config:get_myhosts()) of
+                             true ->
+                                 push_roster_item(U, S, LUser, LServer, GroupName,
+                                                  Subscription);
+                             _ ->
+                                 ok
+                         end
                  end,
                  get_group_users(Host, Group)).