projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Runtime config: MRF changes
[akkoma]
/
lib
/
pleroma
/
user.ex
diff --git
a/lib/pleroma/user.ex
b/lib/pleroma/user.ex
index e972247316c0ad7aed9acf6b6f06857be3133691..b2f59ab6b61abc7a55df3fdd533a52c317635d85 100644
(file)
--- a/
lib/pleroma/user.ex
+++ b/
lib/pleroma/user.ex
@@
-42,6
+42,10
@@
defmodule Pleroma.User do
end
end
end
end
+ def profile_url(%User{info: %{"source_data" => %{"url" => url}}}), do: url
+ def profile_url(%User{ap_id: ap_id}), do: ap_id
+ def profile_url(_), do: nil
+
def ap_id(%User{nickname: nickname}) do
"#{Web.base_url()}/users/#{nickname}"
end
def ap_id(%User{nickname: nickname}) do
"#{Web.base_url()}/users/#{nickname}"
end
@@
-291,6
+295,7
@@
defmodule Pleroma.User do
def invalidate_cache(user) do
Cachex.del(:user_cache, "ap_id:#{user.ap_id}")
Cachex.del(:user_cache, "nickname:#{user.nickname}")
def invalidate_cache(user) do
Cachex.del(:user_cache, "ap_id:#{user.ap_id}")
Cachex.del(:user_cache, "nickname:#{user.nickname}")
+ Cachex.del(:user_cache, "user_info:#{user.id}")
end
def get_cached_by_ap_id(ap_id) do
end
def get_cached_by_ap_id(ap_id) do
@@
-618,8
+623,8
@@
defmodule Pleroma.User do
)
end
)
end
- def deactivate(%User{} = user) do
- new_info = Map.put(user.info, "deactivated",
true
)
+ def deactivate(%User{} = user
, status \\ true
) do
+ new_info = Map.put(user.info, "deactivated",
status
)
cs = User.info_changeset(user, %{info: new_info})
update_and_set_cache(cs)
end
cs = User.info_changeset(user, %{info: new_info})
update_and_set_cache(cs)
end
@@
-652,7
+657,7
@@
defmodule Pleroma.User do
end
end)
end
end)
- :ok
+ {:ok, user}
end
def html_filter_policy(%User{info: %{"no_rich_text" => true}}) do
end
def html_filter_policy(%User{info: %{"no_rich_text" => true}}) do