diff options
author | eal <eal@waifu.club> | 2017-11-20 07:58:43 +0200 |
---|---|---|
committer | eal <eal@waifu.club> | 2017-11-20 07:58:43 +0200 |
commit | bd921ca5d7830efc9dde68b763412fdc03725adc (patch) | |
tree | 665e38138220ba7ec345a82c1d27123cc64ec3a7 | |
parent | edc3e5bc3014b1ca395038736dd8fd6b6aeed560 (diff) | |
download | pleroma-bd921ca5d7830efc9dde68b763412fdc03725adc.tar.gz |
Fix posts being streamed to non-local websocket channels.
-rw-r--r-- | lib/pleroma/user.ex | 6 | ||||
-rw-r--r-- | test/user_test.exs | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 59d4fb839..f80c0ae33 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -286,12 +286,12 @@ defmodule Pleroma.User do def get_recipients_from_activity(%Activity{data: %{"to" => to}}) do query = from u in User, - where: u.local == true - - query = from u in query, where: u.ap_id in ^to, or_where: fragment("? \\\?| ?", u.following, ^to) + query = from u in query, + where: u.local == true + Repo.all(query) end diff --git a/test/user_test.exs b/test/user_test.exs index c06663ed7..8ec23c751 100644 --- a/test/user_test.exs +++ b/test/user_test.exs @@ -318,6 +318,7 @@ defmodule Pleroma.UserTest do assert [addressed] == User.get_recipients_from_activity(activity) {:ok, user} = User.follow(user, actor) + {:ok, user_two} = User.follow(user_two, actor) recipients = User.get_recipients_from_activity(activity) assert length(recipients) == 2 assert user in recipients |