update copyright years to 2019
[akkoma] / lib / pleroma / activity.ex
index be04363aab20b7c11db4534ed8844e083a599867..353f9f6cd7722d915369218576540e77c2efc89e 100644 (file)
@@ -1,7 +1,13 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
 defmodule Pleroma.Activity do
   use Ecto.Schema
   alias Pleroma.{Repo, Activity, Notification}
-  import Ecto.{Query, Changeset}
+  import Ecto.Query
+
+  @type t :: %__MODULE__{}
 
   # https://github.com/tootsuite/mastodon/blob/master/app/models/notification.rb#L19
   @mastodon_notification_types %{
@@ -103,25 +109,4 @@ defmodule Pleroma.Activity do
   end
 
   def mastodon_notification_type(%Activity{}), do: nil
-
-  def get_tombstone(%Activity{data: data}, deleted \\ DateTime.utc_now()) do
-    %{
-      id: data["id"],
-      context: data["context"],
-      type: "Tombstone",
-      published: data["published"],
-      deleted: deleted
-    }
-  end
-
-  def swap_data_with_tombstone(activity) do
-    with tombstone = get_tombstone(activity),
-         Notification.clear(activity),
-         {:ok, changed_activity} =
-           activity
-           |> change(%{data: tombstone})
-           |> Repo.update() do
-      {:ok, changed_activity}
-    end
-  end
 end