Compare commits
2 commits
144bfb57e2
...
02bdaef80d
Author | SHA1 | Date | |
---|---|---|---|
02bdaef80d | |||
4640e3a36b |
5 changed files with 14 additions and 17 deletions
|
@ -96,15 +96,11 @@ defmodule Nulla.ActivityPub do
|
|||
type: "Note",
|
||||
summary: nil,
|
||||
inReplyTo: note.inReplyTo,
|
||||
published: note.inserted_at,
|
||||
published: note.published,
|
||||
url: note.url,
|
||||
attributedTo: note.actor.ap_id,
|
||||
to: [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
cc: [
|
||||
"#{note.actor.ap_id}/followers"
|
||||
],
|
||||
to: note.to,
|
||||
cc: note.cc,
|
||||
sensitive: note.sensitive,
|
||||
content: note.content,
|
||||
contentMap: Jason.OrderedObject.new("#{note.language}": note.content),
|
||||
|
@ -341,6 +337,7 @@ defmodule Nulla.ActivityPub do
|
|||
to: [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
cc: [],
|
||||
object:
|
||||
Jason.OrderedObject.new(
|
||||
id: "#{note.actor.ap_id}/notes/#{note.id}",
|
||||
|
|
|
@ -11,8 +11,8 @@ defmodule Nulla.Models.Activity do
|
|||
field :type, :string
|
||||
field :actor, :string
|
||||
field :object, :string
|
||||
field :to, :string
|
||||
field :cc, :string
|
||||
field :to, {:array, :string}
|
||||
field :cc, {:array, :string}
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
|
|
@ -10,12 +10,10 @@ defmodule Nulla.Models.Note do
|
|||
@primary_key {:id, :integer, autogenerate: false}
|
||||
schema "notes" do
|
||||
field :inReplyTo, :string
|
||||
field :published, :utc_datetime
|
||||
field :url, :string
|
||||
|
||||
field :visibility, Ecto.Enum,
|
||||
values: [:public, :unlisted, :followers, :private],
|
||||
default: :public
|
||||
|
||||
field :to, {:array, :string}
|
||||
field :cc, {:array, :string}
|
||||
field :sensitive, :boolean, default: false
|
||||
field :content, :string
|
||||
field :language, :string
|
||||
|
|
|
@ -5,8 +5,10 @@ defmodule Nulla.Repo.Migrations.CreateNotes do
|
|||
create table(:notes, primary_key: false) do
|
||||
add :id, :bigint, primary_key: true
|
||||
add :inReplyTo, :string
|
||||
add :published, :utc_datetime
|
||||
add :url, :string
|
||||
add :visibility, :string, default: "public"
|
||||
add :to, {:array, :string}
|
||||
add :cc, {:array, :string}
|
||||
add :sensitive, :boolean, default: false
|
||||
add :content, :text
|
||||
add :language, :string
|
||||
|
|
|
@ -8,8 +8,8 @@ defmodule Nulla.Repo.Migrations.CreateActivities do
|
|||
add :type, :string, null: false
|
||||
add :actor, :string, null: false
|
||||
add :object, :text, null: false
|
||||
add :to, :text
|
||||
add :cc, :text
|
||||
add :to, {:array, :string}
|
||||
add :cc, {:array, :string}
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue