+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
defmodule Pleroma.Notification do
use Ecto.Schema
alias Pleroma.{User, Activity, Notification, Repo, Object}
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)