User: Change signature of get_users_from_set
authorlain <lain@soykaf.club>
Mon, 25 May 2020 13:06:35 +0000 (15:06 +0200)
committerlain <lain@soykaf.club>
Mon, 25 May 2020 13:06:35 +0000 (15:06 +0200)
lib/pleroma/conversation.ex
lib/pleroma/notification.ex
lib/pleroma/user.ex

index 37d455cfc865b358dfb22a2228910a87cf487743..e76eb008746514f854533eb6fe4a23ff7fa15aac 100644 (file)
@@ -63,7 +63,7 @@ defmodule Pleroma.Conversation do
          ap_id when is_binary(ap_id) and byte_size(ap_id) > 0 <- object.data["context"] do
       {:ok, conversation} = create_for_ap_id(ap_id)
 
-      users = User.get_users_from_set(activity.recipients, false)
+      users = User.get_users_from_set(activity.recipients, local_only: false)
 
       participations =
         Enum.map(users, fn user ->
index 8aa9ed2d48f80098909de61aa53a9d41b4dcf7c2..557961e94cfa605d36bc5291be6656307980f7c2 100644 (file)
@@ -370,7 +370,8 @@ defmodule Pleroma.Notification do
       when type in ["Create", "Like", "Announce", "Follow", "Move", "EmojiReact"] do
     potential_receiver_ap_ids = get_potential_receiver_ap_ids(activity)
 
-    potential_receivers = User.get_users_from_set(potential_receiver_ap_ids, local_only)
+    potential_receivers =
+      User.get_users_from_set(potential_receiver_ap_ids, local_only: local_only)
 
     notification_enabled_ap_ids =
       potential_receiver_ap_ids
index d2eeeb479dd07a7fb83b9b0022a421e94da18307..f57cd3e74ba77a18d618166bcc043f570c6b7e6b 100644 (file)
@@ -1208,8 +1208,9 @@ defmodule Pleroma.User do
 
   def increment_unread_conversation_count(_, user), do: {:ok, user}
 
-  @spec get_users_from_set([String.t()], boolean()) :: [User.t()]
-  def get_users_from_set(ap_ids, local_only \\ true) do
+  @spec get_users_from_set([String.t()], keyword()) :: [User.t()]
+  def get_users_from_set(ap_ids, opts \\ []) do
+    local_only = Keyword.get(opts, :local_only, true)
     criteria = %{ap_id: ap_ids, deactivated: false}
     criteria = if local_only, do: Map.put(criteria, :local, true), else: criteria