Revert unneeded changes
authorMaxim Filippov <colixer@gmail.com>
Tue, 25 Dec 2018 00:44:48 +0000 (03:44 +0300)
committerMaxim Filippov <colixer@gmail.com>
Tue, 25 Dec 2018 00:44:48 +0000 (03:44 +0300)
lib/pleroma/notification.ex
lib/pleroma/web/activity_pub/transmogrifier.ex
lib/pleroma/web/common_api/utils.ex

index 457cba9350244e748ffcb2454affbbc47631dab2..47578d60e04717c81794aa4ed3feb604837e59c0 100644 (file)
@@ -75,16 +75,11 @@ defmodule Pleroma.Notification do
     end
   end
 
-  def clear(%User{} = user) do
+  def clear(user) do
     from(n in Notification, where: n.user_id == ^user.id)
     |> Repo.delete_all()
   end
 
-  def clear(%Activity{} = activity) do
-    from(n in Notification, where: n.activity_id == ^activity.id)
-    |> Repo.delete_all()
-  end
-
   def dismiss(%{id: user_id} = _user, id) do
     notification = Repo.get(Notification, id)
 
index 87514870de10ce59129712596d10c656200268f7..e6af4b211a5cc81018b066110eb90ece0f5ec3e4 100644 (file)
@@ -586,8 +586,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
   end
 
   def set_reply_to_uri(%{"inReplyTo" => inReplyTo} = object) do
-    with false <- is_nil(inReplyTo),
-         false <- String.starts_with?(inReplyTo, "http"),
+    with false <- String.starts_with?(inReplyTo, "http"),
          {:ok, %{data: replied_to_object}} <- get_obj_helper(inReplyTo) do
       Map.put(object, "inReplyTo", replied_to_object["external_url"] || inReplyTo)
     else
index d25fef6bce05a5b2091897cbb754e54ce47fe523..142283684b4d176448edd7605c8bae7eb7b79b0f 100644 (file)
@@ -69,12 +69,7 @@ defmodule Pleroma.Web.CommonAPI.Utils do
     mentioned_users = Enum.map(mentions, fn {_, %{ap_id: ap_id}} -> ap_id end)
 
     if inReplyTo do
-      to =
-        [inReplyTo.data["actor"] | mentioned_users]
-        |> Enum.uniq()
-        |> Enum.reject(&is_nil/1)
-
-      {to, []}
+      {Enum.uniq([inReplyTo.data["actor"] | mentioned_users]), []}
     else
       {mentioned_users, []}
     end