Commit Graph

16 Commits (384e953b75abdb15333bf3053cc3d27be88a0cef)

Author SHA1 Message Date
Eugen Rochko d98de8ada7
Get rid of all batch order warnings (#8334) 6 years ago
Eugen Rochko 64db9ed5f6
After blocking domain with reject_media, invalidate cache (#6679)
Media attachments are part of the association cache of statuses,
since they are presumed to be immutable. Unless this cache is
cleared manually, the statuses will continue to look like they
have media embedded.
7 years ago
Eugen Rochko 09a94b575e Admin interface for listing, adding and removing custom emojis (#5002)
* Admin interface for listing, adding and removing custom emojis

* Only display local ones in the list
7 years ago
Eugen Rochko 3534e115e5 Do not try to re-subscribe to unsubscribed accounts (#4653) 7 years ago
sdukhovni 06d905f415 Allow domain blocks that only reject media without silencing or suspending (#4325)
* Allow domain blocks to reject media without silencing or suspending

* Fix typo

* Hide 'Reject media' button when superfluous, instead of disabling it

* Properly hide 'reject media' checkbox on page load if needed

This may happen when resubmitting the domain block form after an error.

* Don't ask whether undoing a media-only block should be retroactive

* Rename :media_only block to :noop

* Display :noop block as None in frontend, allow blocks that do nothing

* Remove 'coding' line auto-added by emacs
7 years ago
Akihiko Odaki f554807563 Use joins for account properties (#3167) 8 years ago
alpaca-tc a0b1951791 Refactor domain_blocks_controller (#2843)
* Set domain_block by before_action

* Cast value with ActiveRecord::Type

* Batch update
8 years ago
Patrick Figel 197af5de70 Set unknown attachment type when adding domain blocks (#2605)
Follow-up to #2599. When a domain block with `reject_media` is
added or `rake mastodon:media:remove_remote` is invoked, mastodon
deletes the locally cached attachments and avatars but does not
reflect that change in the database, causing the `file` fields to
still have values. This change persists the deletion in the
database and sets the attachment type to unknown.

This also introduces a one-off rake task that sets all attachments
without a local file to the "unknown" type. The upgrade notes for
the next release should contain a post-upgrade step with
`rake mastodon:media:set_unknown`.
8 years ago
Matt Jankowski 8857cabca4 Domain block service cleanup (#2490)
* Add coverage for domain block service with silence

* Get rid of warning about find_each and order

* Move domain_block to attr_reader

* Move optional clear_media into silence_accounts method

* Use blocked_domain method to reduce passed vars

* Extract blocked_domain_accounts method to find accounts on the domain

* Extract media_from_blocked_domain method to find relevant attachments

* Separate destruction of account images and account attachments
8 years ago
Eugen 5d710b1139 Make file attachment on MediaAttachment optional (#1865)
Create MediaAttachment but without actual file download when domain is blocked with reject_media set to true
Clean up old media files when creating a new domain block with reject_media set to true
Return remote_url in media attachments API if local file is not present
Undo domain block action in admin UI
Ability to enable reject_media from admin UI
8 years ago
Eugen Rochko b7c1b12367 Make default admin UI page reports. Add admin UI for creating a domain block 8 years ago
Eugen Rochko 6d98a73180 Domain blocks now have varying severity - auto-suspend vs auto-silence 8 years ago
Eugen Rochko fdc17bea58 Fix rubocop issues, introduce usage of frozen literal to improve performance 8 years ago
Eugen Rochko abb8f5837e Fix public channel 8 years ago
Eugen Rochko 65ae9637d6 PuSH unsubscribe needs correct callback URL 8 years ago
Eugen Rochko 22a8801dbc Adding domain blocks 8 years ago