projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updated tests
[akkoma]
/
lib
/
pleroma
/
user.ex
diff --git
a/lib/pleroma/user.ex
b/lib/pleroma/user.ex
index fb1f2425438c0de4b5e7c38b652dca8e5187f2e4..520dc98bd316b72b05e4f8ff6164ccb488210cd9 100644
(file)
--- a/
lib/pleroma/user.ex
+++ b/
lib/pleroma/user.ex
@@
-517,6
+517,11
@@
defmodule Pleroma.User do
|> Repo.all()
end
|> Repo.all()
end
+ def get_all_by_ids(ids) do
+ from(u in __MODULE__, where: u.id in ^ids)
+ |> Repo.all()
+ end
+
# This is mostly an SPC migration fix. This guesses the user nickname by taking the last part
# of the ap_id and the domain and tries to get that user
def get_by_guessed_nickname(ap_id) do
# This is mostly an SPC migration fix. This guesses the user nickname by taking the last part
# of the ap_id and the domain and tries to get that user
def get_by_guessed_nickname(ap_id) do
@@
-789,6
+794,19
@@
defmodule Pleroma.User do
|> update_and_set_cache()
end
|> update_and_set_cache()
end
+ def update_mascot(user, url) do
+ info_changeset =
+ User.Info.mascot_update(
+ user.info,
+ url
+ )
+
+ user
+ |> change()
+ |> put_embed(:info, info_changeset)
+ |> update_and_set_cache()
+ end
+
@spec maybe_fetch_follow_information(User.t()) :: User.t()
def maybe_fetch_follow_information(user) do
with {:ok, user} <- fetch_follow_information(user) do
@spec maybe_fetch_follow_information(User.t()) :: User.t()
def maybe_fetch_follow_information(user) do
with {:ok, user} <- fetch_follow_information(user) do
@@
-936,9
+954,7
@@
defmodule Pleroma.User do
def unsubscribe(unsubscriber, %{ap_id: ap_id}) do
with %User{} = user <- get_cached_by_ap_id(ap_id) do
def unsubscribe(unsubscriber, %{ap_id: ap_id}) do
with %User{} = user <- get_cached_by_ap_id(ap_id) do
- info_cng =
- user.info
- |> User.Info.remove_from_subscribers(unsubscriber.ap_id)
+ info_cng = User.Info.remove_from_subscribers(user.info, unsubscriber.ap_id)
change(user)
|> put_embed(:info, info_cng)
change(user)
|> put_embed(:info, info_cng)