Commit graph

30 commits

Author SHA1 Message Date
Gregory Igelmund
1a7b7f5d18 Enable Turbo Drive with morphing for Messages#{destroy,mark} 2024-03-21 14:55:16 +01:00
Gregory Igelmund
efc61f1315 Add basic structures for UserMute and Message muting logic
Including models, migration, controllers, views & locales.
2023-12-19 12:57:47 -05:00
Andy Allan
4af54ce93b Use Activerecord '#or' method for queries
That let's us use relation names (like `sender`) and avoid dealing
directly with ids.
2023-08-30 17:17:15 +01:00
Anton Khorev
4ceebefefa Move user lookup and error render to concerns 2023-08-21 17:29:55 +03:00
Andy Allan
6bbd8490fe Remove outdated comments
The action no longer deals with sending, and there's no display_name
param in this bit of code so it's a bit confusing.
2022-11-02 11:22:29 +00:00
Andy Allan
22946d703a Enable the ActionOrder cop for remaining controllers
Where actions were reordered, the rails standard actions were
also moved to the top of each controller.
2022-11-02 11:06:00 +00:00
Tom Hughes
40ec4734fb Fix new rubocop warnings 2022-05-16 19:16:53 +01:00
Tom Hughes
b5f06e06c1 Fix rubocop Rails/TimeZone warnings 2022-03-01 22:55:10 +00:00
Tom Hughes
407b61857e Improve fallback behaviour for unsafe referer redirects 2021-11-23 17:18:41 +00:00
Tom Hughes
25510b6616 Add additional limits on sending messages
Additional limits apply to new accounts and accounts with
unresolved issues reported against them.

Fixes #3135
2021-03-31 22:40:34 +01:00
Andy Allan
38ad8fbc36 Use login_path instead of explicit controller and actions
This makes future refactoring easier.
2021-03-10 14:31:55 +00:00
Andy Allan
2c1033f62d Rename Notifier to UserMailer
It's a convention in rails to name your mailers with a Mailer suffix, and is also common to name the class after the recipient (e.g. User, Admin). So UserMailer seems a reasonable choice.
2020-10-14 15:04:58 +02:00
Tom Hughes
8d34b03232 Only show the "too many messages" error once
Fixes #2790
2020-08-23 10:41:39 +01:00
Tom Hughes
d4130bcac8 Fix the Redirect warnings from Brakeman
Unfortunately I've had to leave the check disabed as Brakeman
can't see inside the safe_referer method so doesn't realise that
it is cleaning the referer.
2020-07-22 19:23:46 +01:00
Tom Hughes
03cde71a5e Refactor more controller tests 2020-04-26 20:33:06 +01:00
Andy Allan
d102c9aaf4 Move all settings to settings.yml
We leave the STATUS setting alone, since it's required before rails
boots. The test-specific settings now live in config/settings/test.yml
2019-03-13 18:06:23 +01:00
Andy Allan
425f42dd80 Use CanCanCan for messages controller 2019-01-09 15:27:29 +01:00
Andy Allan
b54362d458 Use deliver_later for all email sending 2018-10-31 16:38:12 +01:00
Tom Hughes
b8a8a88004 Merge remote-tracking branch 'upstream/pull/2014' 2018-10-03 18:59:33 +01:00
Andy Allan
3ec67ea2d3 Rename user_controller to users_controller 2018-10-03 15:31:10 +02:00
Andy Allan
5405dde6ec Use resourceful destroy method for messages 2018-09-05 10:38:36 +08:00
Tom Hughes
720da8b78c Avoid multiple returns 2018-08-29 08:53:23 +01:00
Andy Allan
f38e03f0ed Refactor message creation to use a create action
This makes it more conventional, rather than handling posts to the new action. The posting of the form was also reworked to use a hidden field for the displayname, rather than in the url, again for convention.
2018-08-29 14:18:20 +08:00
Andy Allan
3e5a953e8f Fix missing message translation strings 2018-06-06 11:53:05 +08:00
Andy Allan
88ff81b694 Refactor messages show action to be resourceful 2018-06-06 11:51:52 +08:00
Andy Allan
9b36021ec5 Refactor inbox and outbox paths to avoid display names in urls. 2018-06-06 11:33:33 +08:00
Andy Allan
84fa437d50 Ensure database is writable before destroying a message 2018-05-15 18:28:33 +08:00
Andy Allan
4ec70f7994 Rename messages#read to #show
Also rename the named path, to align with resourceful routing
2018-05-15 18:25:54 +08:00
Andy Allan
73df8447e3 Rename messages#delete to destroy
This is a better fit for rails controller method conventions, paving
the way to resourceful routing. Keep user-facing strings as 'delete'
since that's more commonly used.
2018-05-15 18:15:01 +08:00
Andy Allan
00bd64c7fb Rename message_controller to messages_controller 2018-05-09 16:38:37 +08:00
Renamed from app/controllers/message_controller.rb (Browse further)