contents has been renamed to `hide_notification_contents`
- Mastodon API: Added `pleroma.metadata.post_formats` to /api/v1/instance
- Mastodon API (legacy): Allow query parameters for `/api/v1/domain_blocks`, e.g. `/api/v1/domain_blocks?domain=badposters.zone`
+- Mastodon API: Make notifications about statuses from muted users and threads read automatically
- Pleroma API: `/api/pleroma/captcha` responses now include `seconds_valid` with an integer value.
</details>
alias Pleroma.Repo
alias Pleroma.ThreadMute
alias Pleroma.User
+ alias Pleroma.Web.CommonAPI
alias Pleroma.Web.CommonAPI.Utils
alias Pleroma.Web.Push
alias Pleroma.Web.Streamer
def mark_as_read?(activity, target_user) do
user = Activity.user_actor(activity)
- User.mutes_user?(target_user, user)
+ User.mutes_user?(target_user, user) || CommonAPI.thread_muted?(target_user, activity)
end
def for_user_and_activity(user, activity) do
end
def thread_muted?(%User{id: user_id}, %{data: %{"context" => context}})
- when is_binary("context") do
+ when is_binary(context) do
ThreadMute.exists?(user_id, context)
end
in_reply_to_status_id: activity.id
})
- assert Notification.create_notification(activity, muter)
+ notification = Notification.create_notification(activity, muter)
+
+ assert notification.id
+ assert notification.seen
end
test "it disables notifications from strangers" do
{:ok, [notification]} = Notification.create_notifications(status)
assert notification
+ refute notification.seen
end
test "it creates notifications when someone likes user's status with a filtered word" do
{:ok, [notification]} = Notification.create_notifications(activity_two)
assert notification
+ refute notification.seen
end
end