This module encodes our addressing policies and general shape of our objects.
"""
+ alias Pleroma.Object
+ alias Pleroma.User
alias Pleroma.Web.ActivityPub.Utils
alias Pleroma.Web.ActivityPub.Visibility
- alias Pleroma.User
- alias Pleroma.Object
@spec like(User.t(), Object.t()) :: {:ok, map(), keyword()}
def like(actor, object) do
the system.
"""
- alias Pleroma.Web.ActivityPub.ObjectValidators.LikeValidator
- alias Pleroma.User
alias Pleroma.Object
+ alias Pleroma.User
+ alias Pleroma.Web.ActivityPub.ObjectValidators.LikeValidator
@spec validate(map(), keyword()) :: {:ok, map(), keyword()} | {:error, any()}
def validate(object, meta)
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
defmodule Pleroma.Web.ActivityPub.ObjectValidators.LikeValidator do
use Ecto.Schema
import Ecto.Changeset
+ alias Pleroma.Object
+ alias Pleroma.User
alias Pleroma.Web.ActivityPub.ObjectValidators.Types
alias Pleroma.Web.ActivityPub.Utils
- alias Pleroma.User
- alias Pleroma.Object
@primary_key false
liked object, a `Follow` activity will add the user to the follower
collection, and so on.
"""
- alias Pleroma.Web.ActivityPub.Utils
- alias Pleroma.Object
alias Pleroma.Notification
+ alias Pleroma.Object
+ alias Pleroma.Web.ActivityPub.Utils
def handle(object, meta \\ [])
defmodule Pleroma.Web.ActivityPub.ObjectValidatorTest do
use Pleroma.DataCase
- alias Pleroma.Web.CommonAPI
alias Pleroma.Web.ActivityPub.ObjectValidator
alias Pleroma.Web.ActivityPub.ObjectValidators.LikeValidator
alias Pleroma.Web.ActivityPub.Utils
+ alias Pleroma.Web.CommonAPI
+
import Pleroma.Factory
describe "likes" do