constants: add as_public constant and use it everywhere
[akkoma] / lib / pleroma / web / twitter_api / twitter_api.ex
index bb5dda204d0d1cb168a43af9dc35ca24dfae313d..80082ea8495091b6ccbcc61dbec91cc70e11d958 100644 (file)
@@ -15,6 +15,8 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
 
   import Ecto.Query
 
+  require Pleroma.Constants
+
   def create_status(%User{} = user, %{"status" => _} = data) do
     CommonAPI.post(user, data)
   end
@@ -286,7 +288,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
       from(
         [a, o] in Activity.with_preloaded_object(Activity),
         where: fragment("?->>'type' = 'Create'", a.data),
-        where: "https://www.w3.org/ns/activitystreams#Public" in a.recipients,
+        where: ^Pleroma.Constants.as_public() in a.recipients,
         where:
           fragment(
             "to_tsvector('english', ?->>'content') @@ plainto_tsquery('english', ?)",