user: add helper function to fetch a user given only an ap_id (fix tests)
This commit is contained in:
parent
3707a7fa42
commit
056305dfa7
@ -527,6 +527,11 @@ defmodule Pleroma.User do
|
|||||||
update_and_set_cache(cs)
|
update_and_set_cache(cs)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# helper to handle the block given only an actor's AP id
|
||||||
|
def block(blocker, %{ap_id: ap_id}) do
|
||||||
|
block(blocker, User.get_by_ap_id(ap_id))
|
||||||
|
end
|
||||||
|
|
||||||
def unblock(user, %{ap_id: ap_id}) do
|
def unblock(user, %{ap_id: ap_id}) do
|
||||||
blocks = user.info["blocks"] || []
|
blocks = user.info["blocks"] || []
|
||||||
new_blocks = List.delete(blocks, ap_id)
|
new_blocks = List.delete(blocks, ap_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user