mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-27 00:09:35 +00:00
Make subscriptions the same direction as blocks
That being, user - subscribes to -> users, rather than user - has subscribers -> users
This commit is contained in:
parent
23c4f49494
commit
316fe20d86
|
@ -1006,7 +1006,12 @@ defmodule Pleroma.User do
|
|||
do: Repo.all(from(u in User, where: u.ap_id in ^user.info.blocks))
|
||||
|
||||
def subscribed_users(user),
|
||||
do: Repo.all(from(u in User, where: u.ap_id in ^user.info.subscriptions))
|
||||
do:
|
||||
Repo.all(
|
||||
from(u in User,
|
||||
where: fragment("?->'subscriptions' @> ?", u.info, ^user.ap_id)
|
||||
)
|
||||
)
|
||||
|
||||
def block_domain(user, domain) do
|
||||
info_cng =
|
||||
|
|
|
@ -338,7 +338,8 @@ defmodule Pleroma.Web.CommonAPI.Utils do
|
|||
def maybe_notify_subscribers(
|
||||
recipients,
|
||||
%Activity{data: %{"actor" => actor, "type" => type}}
|
||||
) when type == "Create" do
|
||||
)
|
||||
when type == "Create" do
|
||||
with %User{} = user <- User.get_by_ap_id(actor) do
|
||||
subscriber_ids =
|
||||
user
|
||||
|
|
Loading…
Reference in a new issue