aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/ostatus
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-07-29 16:30:47 +0000
committerlain <lain@soykaf.club>2019-07-29 16:30:47 +0000
commit1dfde4151ca096742da593160d33a629494c9f1c (patch)
tree8999d2c1ccdea93e55e1ac7961778bc8d9054873 /lib/pleroma/web/ostatus
parent3b8cd27b053e08bfb06a248033477efdb9e78684 (diff)
parentb93498eb5289dc92587b77c316ed9f697bb9e5c8 (diff)
downloadpleroma-1dfde4151ca096742da593160d33a629494c9f1c.tar.gz
Merge branch 'refactor/use-constants' into 'develop'
refactoring: begin to use constants See merge request pleroma/pleroma!1500
Diffstat (limited to 'lib/pleroma/web/ostatus')
-rw-r--r--lib/pleroma/web/ostatus/activity_representer.ex3
-rw-r--r--lib/pleroma/web/ostatus/handlers/note_handler.ex5
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/pleroma/web/ostatus/activity_representer.ex b/lib/pleroma/web/ostatus/activity_representer.ex
index 95037125d..760345301 100644
--- a/lib/pleroma/web/ostatus/activity_representer.ex
+++ b/lib/pleroma/web/ostatus/activity_representer.ex
@@ -9,6 +9,7 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenter do
alias Pleroma.Web.OStatus.UserRepresenter
require Logger
+ require Pleroma.Constants
defp get_href(id) do
with %Object{data: %{"external_url" => external_url}} <- Object.get_cached_by_ap_id(id) do
@@ -34,7 +35,7 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenter do
Enum.map(to, fn id ->
cond do
# Special handling for the AP/Ostatus public collections
- "https://www.w3.org/ns/activitystreams#Public" == id ->
+ Pleroma.Constants.as_public() == id ->
{:link,
[
rel: "mentioned",
diff --git a/lib/pleroma/web/ostatus/handlers/note_handler.ex b/lib/pleroma/web/ostatus/handlers/note_handler.ex
index 8e0adad91..3005e8f57 100644
--- a/lib/pleroma/web/ostatus/handlers/note_handler.ex
+++ b/lib/pleroma/web/ostatus/handlers/note_handler.ex
@@ -4,6 +4,7 @@
defmodule Pleroma.Web.OStatus.NoteHandler do
require Logger
+ require Pleroma.Constants
alias Pleroma.Activity
alias Pleroma.Object
@@ -49,7 +50,7 @@ defmodule Pleroma.Web.OStatus.NoteHandler do
def get_collection_mentions(entry) do
transmogrify = fn
"http://activityschema.org/collection/public" ->
- "https://www.w3.org/ns/activitystreams#Public"
+ Pleroma.Constants.as_public()
group ->
group
@@ -126,7 +127,7 @@ defmodule Pleroma.Web.OStatus.NoteHandler do
to <- make_to_list(actor, mentions),
date <- XML.string_from_xpath("//published", entry),
unlisted <- XML.string_from_xpath("//mastodon:scope", entry) == "unlisted",
- cc <- if(unlisted, do: ["https://www.w3.org/ns/activitystreams#Public"], else: []),
+ cc <- if(unlisted, do: [Pleroma.Constants.as_public()], else: []),
note <-
CommonAPI.Utils.make_note_data(
actor.ap_id,