use Ecto.Schema
import Ecto.Changeset
- alias Pleroma.User
alias Pleroma.Repo
+ alias Pleroma.User
@moduledoc """
Chat keeps a reference to ChatMessage conversations between a user and an recipient. The recipient can be a user (for now) or a group (not implemented yet).
alias Pleroma.Object
alias Pleroma.User
- alias Pleroma.Web.ActivityPub.ObjectValidators.LikeValidator
alias Pleroma.Web.ActivityPub.ObjectValidators.ChatMessageValidator
alias Pleroma.Web.ActivityPub.ObjectValidators.CreateChatMessageValidator
+ alias Pleroma.Web.ActivityPub.ObjectValidators.LikeValidator
@spec validate(map(), keyword()) :: {:ok, map(), keyword()} | {:error, any()}
def validate(object, meta)
defmodule Pleroma.Web.ActivityPub.ObjectValidators.ChatMessageValidator do
use Ecto.Schema
- alias Pleroma.Web.ActivityPub.ObjectValidators.Types
alias Pleroma.User
+ alias Pleroma.Web.ActivityPub.ObjectValidators.Types
import Ecto.Changeset
alias Pleroma.ActivityExpiration
alias Pleroma.Conversation.Participation
alias Pleroma.FollowingRelationship
+ alias Pleroma.Formatter
alias Pleroma.Object
alias Pleroma.Repo
alias Pleroma.ThreadMute
alias Pleroma.Web.ActivityPub.Pipeline
alias Pleroma.Web.ActivityPub.Utils
alias Pleroma.Web.ActivityPub.Visibility
- alias Pleroma.Formatter
import Pleroma.Web.Gettext
import Pleroma.Web.CommonAPI.Utils
alias Pleroma.Activity
alias Pleroma.Notification
- alias Pleroma.User
alias Pleroma.Object
+ alias Pleroma.User
alias Pleroma.UserRelationship
alias Pleroma.Web.CommonAPI
alias Pleroma.Web.MastodonAPI.AccountView
end
end
- # This returns the notification type by activity, but both chats and statuses are in "Create" activities.
+ # This returns the notification type by activity, but both chats and statuses
+ # are in "Create" activities.
mastodon_type =
case Activity.mastodon_notification_type(activity) do
"mention" ->
alias Pleroma.Chat
alias Pleroma.Object
+ alias Pleroma.Pagination
+ alias Pleroma.Plugs.OAuthScopesPlug
alias Pleroma.Repo
alias Pleroma.User
- alias Pleroma.Plugs.OAuthScopesPlug
alias Pleroma.Web.CommonAPI
- alias Pleroma.Web.PleromaAPI.ChatView
alias Pleroma.Web.PleromaAPI.ChatMessageView
- alias Pleroma.Pagination
+ alias Pleroma.Web.PleromaAPI.ChatView
import Ecto.Query
defmodule Pleroma.Web.ActivityPub.ObjectValidatorTest do
use Pleroma.DataCase
+ alias Pleroma.Web.ActivityPub.Builder
alias Pleroma.Web.ActivityPub.ObjectValidator
alias Pleroma.Web.ActivityPub.ObjectValidators.LikeValidator
alias Pleroma.Web.ActivityPub.Utils
alias Pleroma.Web.CommonAPI
- alias Pleroma.Web.ActivityPub.Builder
import Pleroma.Factory
use Pleroma.DataCase
alias Pleroma.Chat
- alias Pleroma.Web.PleromaAPI.ChatView
alias Pleroma.Web.MastodonAPI.AccountView
+ alias Pleroma.Web.PleromaAPI.ChatView
import Pleroma.Factory