]> cat aescling's git repositories - mastodon.git/commitdiff
Keep statuses bookmarked by local users in tootctl statuses remove (#12818)
authorGomasy <nyan@gomasy.jp>
Sat, 11 Jan 2020 05:41:37 +0000 (14:41 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 11 Jan 2020 05:41:37 +0000 (06:41 +0100)
lib/mastodon/statuses_cli.rb

index 74f15de5f779c332e079d25296f685e1275e706e..ecaac17e3ab245ffff4d2dcd291268c6b4f2e920 100644 (file)
@@ -48,6 +48,8 @@ module Mastodon
       scope = scope.where('id NOT IN (SELECT statuses1.reblog_of_id FROM statuses AS statuses1 WHERE statuses.id = statuses1.reblog_of_id AND (statuses1.uri IS NULL OR statuses1.local OR statuses1.id >= ?))', max_id)
       # Skip statuses favourited by local users
       scope = scope.where('id NOT IN (SELECT favourites.status_id FROM favourites WHERE statuses.id = favourites.status_id AND favourites.account_id IN (SELECT accounts.id FROM accounts WHERE domain IS NULL))')
+      # Skip statuses bookmarked by local users
+      scope = scope.where('id NOT IN (SELECT bookmarks.status_id FROM bookmarks WHERE statuses.id = bookmarks.status_id AND bookmarks.account_id IN (SELECT accounts.id FROM accounts WHERE domain IS NULL))')
 
       unless options[:clean_followed]
         # Skip accounts followed by local accounts