User: Truncate bios when updating a remote user.
[akkoma] / lib / pleroma / notification.ex
index 815356a5e5ed12c5b46753865428dec2144dcca0..556075fbab791ee7a34541f2bbbb76c83d3e0d54 100644 (file)
@@ -271,6 +271,16 @@ defmodule Pleroma.Notification do
     |> Repo.delete_all()
   end
 
+  def dismiss(%Pleroma.Activity{} = activity) do
+    Notification
+    |> where([n], n.activity_id == ^activity.id)
+    |> Repo.delete_all()
+    |> case do
+      {_, notifications} -> {:ok, notifications}
+      _ -> {:error, "Cannot dismiss notification"}
+    end
+  end
+
   def dismiss(%{id: user_id} = _user, id) do
     notification = Repo.get(Notification, id)