Implement mastodon's reblog hiding feature
This commit is contained in:
parent
41fc67aa49
commit
c8f31e0bc2
6 changed files with 56 additions and 2 deletions
|
|
@ -21,6 +21,7 @@ defmodule Pleroma.User.Info do
|
|||
field(:blocks, {:array, :string}, default: [])
|
||||
field(:domain_blocks, {:array, :string}, default: [])
|
||||
field(:mutes, {:array, :string}, default: [])
|
||||
field(:muted_reblogs, {:array, :string}, default: [])
|
||||
field(:deactivated, :boolean, default: false)
|
||||
field(:no_rich_text, :boolean, default: false)
|
||||
field(:ap_enabled, :boolean, default: false)
|
||||
|
|
@ -259,4 +260,16 @@ defmodule Pleroma.User.Info do
|
|||
moderator: is_moderator
|
||||
}
|
||||
end
|
||||
|
||||
def add_reblog_mute(info, id) do
|
||||
params = %{muted_reblogs: info.muted_reblogs ++ [id]}
|
||||
|
||||
cast(info, params, [:muted_reblogs])
|
||||
end
|
||||
|
||||
def remove_reblog_mute(info, id) do
|
||||
params = %{muted_reblogs: List.delete(info.muted_reblogs, id)}
|
||||
|
||||
cast(info, params, [:muted_reblogs])
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue