discourse/app/services
Blake Erickson 367de2594d
FIX: Unlike own posts on ownership transfer (#10446)
* FIX: Unlike own posts on ownership transfer

If a user has liked a post that has passed the
`post_undo_action_window_mins` system setting window and you transfer ownership
of that post to that user you will be the owner of a post that you have
liked, but cannot unlike resulting in a weird UI behavior. This commit
fixes this issue.

The existing tests didn't check for the timeout window for unliking
posts so I added that in.

I couldn't find a good way to do this logic inside of the guardian class
so rather than duplicating behavior of the `PostActionDestroyer` class
inside of the `PostOwnerChanger` I decided to pass in a "bypass"
variable that could be used to check if the calling class is the
'post_owner_changer' and bypass the guardian instead. I went this route
because the guardian `can_delete_post_action` method has no way of
distinguishing how to allow a user to be able to unlike their own posts
after the timeout window but only on a post owner change.

* use an options hash instead
2020-08-19 09:21:02 -06:00
..
spam_rule FIX: use allowlist and blocklist terminology (#10209) 2020-07-27 10:23:54 +10:00
anonymous_shadow_creator.rb FIX: ensures shadow has last_posted_at before comparing to site setting (#10374) 2020-08-05 13:20:51 +02:00
badge_granter.rb FEATURE: add option to skip new user tips in first notification. (#10462) 2020-08-18 13:43:40 +05:30
color_scheme_revisor.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
destroy_task.rb DEV: Better error handling for destroy:users task (#9939) 2020-06-01 08:55:08 -07:00
email_style_updater.rb FEATURE: support SCSS in custom email style 2019-10-23 15:42:37 -04:00
group_action_logger.rb FEATURE - Moderators can create and manage groups (#10432) 2020-08-19 10:41:40 -04:00
group_mentions_updater.rb FIX: Mentions updater should work regardless of .notify 2020-02-18 16:02:26 -05:00
group_message.rb DEV: s/\$redis/Discourse\.redis (#8431) 2019-12-03 10:05:53 +01:00
handle_chunk_upload.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
heat_settings_updater.rb FIX: round the calculated heat values 2019-06-06 15:44:55 -04:00
inline_uploads.rb FEATURE: Parse images in email signatures (#10137) 2020-07-08 15:50:30 +10:00
notification_consolidator.rb DEV: handle all notification consolidations in new 'NotificationConsolidator' class. 2019-12-05 14:36:06 +05:30
notification_emailer.rb FIX: Staged users getting user_linked and user_quoted emails 2020-03-31 20:17:56 -06:00
post_action_notifier.rb DEV: adds plugin api to add custom recipients of a post revision (#10367) 2020-08-04 11:57:33 +02:00
post_alerter.rb DEV: adds event_reminder (27) and event_invitation (28) (#10473) 2020-08-19 12:07:51 +02:00
post_owner_changer.rb FIX: Unlike own posts on ownership transfer (#10446) 2020-08-19 09:21:02 -06:00
push_notification_pusher.rb DEV: Upgrading Discourse to Zeitwerk (#8098) 2019-10-02 14:01:53 +10:00
random_topic_selector.rb FIX: Use Discourse.system_user when we need a placeholder admin (#9781) 2020-06-24 15:51:30 +10:00
search_indexer.rb PERF: Add partial index for non-pm search. 2020-08-18 15:55:08 +08:00
site_settings_task.rb DEV: Apply Rubocop redundant return style 2019-11-14 15:10:51 -05:00
staff_action_logger.rb FEATURE: Create logs for Group Moderator changes (#10271) 2020-07-21 14:29:02 -04:00
themes_install_task.rb FIX: update theme fields when updating from ThemesInstallTask (#10143) 2020-06-29 13:49:02 -05:00
topic_status_updater.rb FIX: Backfill topic timer duration (#9249) 2020-03-23 09:38:18 +05:30
topic_timestamp_changer.rb DEV: s/\$redis/Discourse\.redis (#8431) 2019-12-03 10:05:53 +01:00
tracked_topics_updater.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
trust_level_granter.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
user_action_manager.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
user_activator.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
user_anonymizer.rb DEV: Drop legacy OpenID 2.0 support (#8894) 2020-02-07 17:32:35 +00:00
user_authenticator.rb FIX: Allow signup when auth provider supplies no email 2020-07-10 17:56:33 +01:00
user_destroyer.rb FIX: use allowlist and blocklist terminology (#10209) 2020-07-27 10:23:54 +10:00
user_merger.rb DEV: move user references deletion code to before_destroy. (#10085) 2020-06-18 17:42:39 -04:00
user_notification_renderer.rb FIX: during concurrent emails generation renderer should not be reused 2019-10-10 08:50:48 +11:00
user_silencer.rb DEV: update rubocop to version 0.77 2019-12-10 11:48:39 +11:00
user_updater.rb User card settings (#10302) 2020-08-17 12:37:45 -04:00
username_changer.rb DEV: Upgrading Discourse to Zeitwerk (#8098) 2019-10-02 14:01:53 +10:00
username_checker_service.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
wildcard_domain_checker.rb SECURITY: vulnerability in WildcardUrlChecker 2019-12-13 09:29:09 -05:00
wildcard_url_checker.rb FIX: Allow any protocol in wildcard url checker (#8651) 2020-01-02 16:03:13 +00:00
word_watcher.rb FIX: Various watched words improvements 2019-08-02 15:29:12 +01:00