Web.CommonAPI: Add local-only posts

A post is local-only when it contains a ️ (👁️) at the end. This is from glitch-soc
This commit is contained in:
Haelwenn (lanodan) Monnier 2018-11-20 23:09:54 +01:00
parent 3e54b79a06
commit 1cd33aa8cd
No known key found for this signature in database
GPG Key ID: D5B7A8E43C997DEE
1 changed files with 4 additions and 2 deletions

View File

@ -124,14 +124,16 @@ defmodule Pleroma.Web.CommonAPI do
|> Enum.reduce(%{}, fn {name, file}, acc ->
Map.put(acc, name, "#{Pleroma.Web.Endpoint.static_url()}#{file}")
end)
) do
),
local_only <- !!(String.last(status) == "👁️") do
res =
ActivityPub.create(%{
to: to,
actor: user,
context: context,
object: object,
additional: %{"cc" => cc}
additional: %{"cc" => cc},
local: local_only
})
res