Last active
November 1, 2018 20:53
-
-
Save ashfurrow/9f40f8cbc1e63df725ab5c1f92d2bb18 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sometimes a user will realize they've been accidentally tooting with the wrong privay setting in a specific browswer or app, and they meant their posts to be private. This script does that. | |
# Hey, uh, admins? Don't do this, unless you *really* trust the user. Changing status privacy after the fact can be abused. See: https://github.com/tootsuite/mastodon/issues/3933 | |
# Open a rails console. | |
ids = %w( PASTE_IDS_LIST ) | |
statuses = ids.map { |i| Status.find(i) } | |
statuses.reject { |s| s.uri.include? "USERNAME" } # Check that all the statuses belong to the user | |
statuses.first.uri # Open in an incognito browser | |
statuses.first.update_attributes!(visibility: :private) # Test one status change | |
# Refresh browser, verify this worked. | |
statuses.map { |s| s.update_attributes!(visibility: :private) }.uniq # Do them all. | |
ids.map { |i| Status.find(i) }.select { |s| s.visibility != "private" } # Verify this is empty. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment