Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# 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
You can’t perform that action at this time.