projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3707a7f
)
user: add helper function to fetch a user given only an ap_id (fix tests)
author
William Pitcock
<nenolod@dereferenced.org>
Tue, 19 Jun 2018 08:31:06 +0000
(08:31 +0000)
committer
William Pitcock
<nenolod@dereferenced.org>
Tue, 19 Jun 2018 08:31:06 +0000
(08:31 +0000)
lib/pleroma/user.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/user.ex
b/lib/pleroma/user.ex
index bfa5d78a42c28d2ccb3f980a579f93c85f5a6968..aba8742a09be5dfd4c639324a7e859f3a72ce1c8 100644
(file)
--- a/
lib/pleroma/user.ex
+++ b/
lib/pleroma/user.ex
@@
-527,6
+527,11
@@
defmodule Pleroma.User do
update_and_set_cache(cs)
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
blocks = user.info["blocks"] || []
new_blocks = List.delete(blocks, ap_id)