From f92dc82dda793d3c8f057a331f6dabdb25b293c2 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 6 Sep 2019 18:28:01 +0300 Subject: [PATCH 1/3] Prioritize the removal of TwitterAPI and :accept_blocks in the changelog --- CHANGELOG.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50a4467e8..f489c52f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - OStatus: eliminate the possibility of a protocol downgrade attack. - OStatus: prevent following locked accounts, bypassing the approval process. +### Removed +- **Breaking:** GNU Social API with Qvitter extensions support +- **Breaking:** ActivityPub: The `accept_blocks` configuration setting. +- Emoji: Remove longfox emojis. +- Remove `Reply-To` header from report emails for admins. + ### Changed - **Breaking:** Configuration: A setting to explicitly disable the mailer was added, defaulting to true, if you are using a mailer add `config :pleroma, Pleroma.Emails.Mailer, enabled: true` to your config - **Breaking:** Configuration: `/media/` is now removed when `base_url` is configured, append `/media/` to your `base_url` config to keep the old behaviour if desired @@ -109,11 +115,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - RichMedia: parsers and their order are configured in `rich_media` config. - RichMedia: add the rich media ttl based on image expiration time. -### Removed -- GNU Social API with Qvitter extensions support -- Emoji: Remove longfox emojis. -- Remove `Reply-To` header from report emails for admins. -- ActivityPub: The `accept_blocks` configuration setting. ## [1.0.1] - 2019-07-14 ### Security From 5effb2cbca51534a68dad1c5a4dd24b1ae08360a Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 6 Sep 2019 23:11:26 +0000 Subject: [PATCH 2/3] activitypub: help ecto build a better query for thread mute filtering using an indexed value in thread_mute table helps ecto build a better query. --- lib/pleroma/web/activity_pub/activity_pub.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index eeb826814..d23ec66ac 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -796,7 +796,7 @@ defp restrict_muted(query, %{"muting_user" => %User{info: info}} = opts) do ) unless opts["skip_preload"] do - from([thread_mute: tm] in query, where: is_nil(tm)) + from([thread_mute: tm] in query, where: is_nil(tm.user_id)) else query end From 40a61532cadbac8b196917c6f5843c3f6cd7e78b Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 6 Sep 2019 23:14:29 +0000 Subject: [PATCH 3/3] activity: when restricting deactivated users, precalculate the user list the PostgreSQL query planner is easily confused due to the complexity of certain queries we make. while we plan to simplify these queries through unification of activities and objects, we are not yet there. it has been discovered that using a precalculated list of deactivated users encourages the query planner to prefer simpler indices instead of the activity_visibility index. accordingly, drop the subquery and precalc the user list instead. --- lib/pleroma/activity.ex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/pleroma/activity.ex b/lib/pleroma/activity.ex index 2d4e9da0c..a7844c36b 100644 --- a/lib/pleroma/activity.ex +++ b/lib/pleroma/activity.ex @@ -362,12 +362,12 @@ def query_by_actor(actor) do end def restrict_deactivated_users(query) do + deactivated_users = + from(u in User.Query.build(deactivated: true), select: u.ap_id) + |> Repo.all() + from(activity in query, - where: - fragment( - "? not in (SELECT ap_id FROM users WHERE info->'deactivated' @> 'true')", - activity.actor - ) + where: activity.actor not in ^deactivated_users ) end