diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-05-06 14:23:39 +0200 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-05-06 14:23:39 +0200 |
commit | 7db76a0f0ef15b42a52f18271e223d1cb8e88c64 (patch) | |
tree | 6a80351aaba0309089e832e756d0131e1f531967 | |
parent | bda389d7d942b7e90ffb519bc680a424a8400e2f (diff) | |
download | pleroma-7db76a0f0ef15b42a52f18271e223d1cb8e88c64.tar.gz |
Address incoming messages to followers.
-rw-r--r-- | lib/pleroma/web/ostatus/ostatus.ex | 3 | ||||
-rw-r--r-- | test/web/ostatus/ostatus_test.exs | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/pleroma/web/ostatus/ostatus.ex b/lib/pleroma/web/ostatus/ostatus.ex index fe42786b2..f335e9972 100644 --- a/lib/pleroma/web/ostatus/ostatus.ex +++ b/lib/pleroma/web/ostatus/ostatus.ex @@ -143,7 +143,8 @@ defmodule Pleroma.Web.OStatus do end to = [ - "https://www.w3.org/ns/activitystreams#Public" + "https://www.w3.org/ns/activitystreams#Public", + User.ap_followers(actor) ] mentions = :xmerl_xpath.string('//link[@rel="mentioned" and @ostatus:object-type="http://activitystrea.ms/schema/1.0/person"]', entry) diff --git a/test/web/ostatus/ostatus_test.exs b/test/web/ostatus/ostatus_test.exs index 1b03c1157..a56e6c4e6 100644 --- a/test/web/ostatus/ostatus_test.exs +++ b/test/web/ostatus/ostatus_test.exs @@ -2,7 +2,7 @@ defmodule Pleroma.Web.OStatusTest do use Pleroma.DataCase alias Pleroma.Web.OStatus alias Pleroma.Web.XML - alias Pleroma.{Object, Repo} + alias Pleroma.{Object, Repo, User} import Pleroma.Factory test "don't insert create notes twice" do @@ -32,6 +32,8 @@ defmodule Pleroma.Web.OStatusTest do assert activity.data["object"]["type"] == "Note" assert activity.data["object"]["actor"] == "https://social.heldscal.la/user/23211" assert activity.data["object"]["content"] == "Will it blend?" + user = User.get_cached_by_ap_id(activity.data["actor"]) + assert User.ap_followers(user) in activity.data["to"] end test "handle incoming notes with attachments - GS, subscription" do |