aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/user.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pleroma/user.ex')
-rw-r--r--lib/pleroma/user.ex54
1 files changed, 3 insertions, 51 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex
index 7bef6e281..5d3f55721 100644
--- a/lib/pleroma/user.ex
+++ b/lib/pleroma/user.ex
@@ -224,54 +224,6 @@ defmodule Pleroma.User do
|> Repo.aggregate(:count, :id)
end
- @info_fields [
- :banner,
- :background,
- :source_data,
- :note_count,
- :follower_count,
- :following_count,
- :locked,
- :confirmation_pending,
- :password_reset_pending,
- :confirmation_token,
- :default_scope,
- :blocks,
- :domain_blocks,
- :mutes,
- :muted_reblogs,
- :muted_notifications,
- :subscribers,
- :deactivated,
- :no_rich_text,
- :ap_enabled,
- :is_moderator,
- :is_admin,
- :show_role,
- :settings,
- :magic_key,
- :uri,
- :hide_followers_count,
- :hide_follows_count,
- :hide_followers,
- :hide_follows,
- :hide_favorites,
- :unread_conversation_count,
- :pinned_activities,
- :email_notifications,
- :mascot,
- :emoji,
- :pleroma_settings_store,
- :fields,
- :raw_fields,
- :discoverable,
- :invisible,
- :skip_thread_containment,
- :notification_settings
- ]
-
- def info_fields, do: @info_fields
-
defp truncate_fields_param(params) do
if Map.has_key?(params, :fields) do
Map.put(params, :fields, Enum.map(params[:fields], &truncate_field/1))
@@ -1019,7 +971,7 @@ defmodule Pleroma.User do
end
end
- def set_unread_conversation_count(_), do: :noop
+ def set_unread_conversation_count(user), do: {:ok, user}
def increment_unread_conversation_count(conversation, %User{local: true} = user) do
unread_query =
@@ -1041,7 +993,7 @@ defmodule Pleroma.User do
end
end
- def increment_unread_conversation_count(_, _), do: :noop
+ def increment_unread_conversation_count(_, user), do: {:ok, user}
def remove_duplicated_following(%User{following: following} = user) do
uniq_following = Enum.uniq(following)
@@ -1125,7 +1077,7 @@ defmodule Pleroma.User do
if following?(blocked, blocker), do: unfollow(blocked, blocker)
{:ok, blocker} = update_follower_count(blocker)
-
+ {:ok, blocker, _} = Participation.mark_all_as_read(blocker, blocked)
add_to_block(blocker, ap_id)
end