Merge branch 'fix/license-attribution' into 'develop'
[akkoma] / lib / pleroma / web / activity_pub / visibility.ex
index 93b50ee473b7cd9a4e27fb51105ee6efa85c42a0..9908a2e75816151e7d203b7736a657a952230a5a 100644 (file)
@@ -1,3 +1,7 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
 defmodule Pleroma.Web.ActivityPub.Visibility do
   alias Pleroma.Activity
   alias Pleroma.Object
@@ -66,6 +70,9 @@ defmodule Pleroma.Web.ActivityPub.Visibility do
       Enum.any?(to, &String.contains?(&1, "/followers")) ->
         "private"
 
+      object.data["directMessage"] == true ->
+        "direct"
+
       length(cc) > 0 ->
         "private"