Commit Graph

143 Commits

Author SHA1 Message Date
Andreas Nedbal 490a06af27 Allow `sharing_custom_url` to be empty 2023-02-05 21:54:51 +01:00
Andreas Nedbal 47d1f5ccff Validate format of `sharing_custom_url` 2023-02-05 21:54:51 +01:00
Andreas Nedbal a56db2256b Return sharing options when answering a question 2023-02-05 21:54:51 +01:00
Andreas Nedbal d520755bc2 Remove service model 2023-02-05 21:54:51 +01:00
Andreas Nedbal fc30bf8cac Add more explicit message for format validation errors 2023-01-21 13:20:52 +01:00
Andreas Nedbal 47bccdb0c3 Fix screen_name regex being too lenient 2023-01-21 13:20:52 +01:00
Andreas Nedbal b72e679a62 Split format and length validation for User `screen_name` 2023-01-21 13:20:52 +01:00
Karina Kwiatek 22a84ab818 Appease the dog overlords 2023-01-02 11:51:45 +01:00
Karina Kwiatek 93d4af3f0d Deduplicate notification sending logic and replace placeholder string 2023-01-02 11:50:47 +01:00
Karina Kwiatek 32ab9267ec Add web push subscription model 2023-01-02 11:50:47 +01:00
Karina Kwiatek 4c158066cb Clean up User model 2023-01-02 11:31:27 +01:00
Andreas Nedbal 361b8df798 Add mute relationship and user methods 2023-01-01 22:42:50 +01:00
Andreas Nedbal 5a0e42fe66 use `has_cached_role?` instead of `has_role?` 2022-12-18 21:47:03 +01:00
Andreas Nedbal 049f92e138 Add inbox locking setting to user 2022-11-06 14:59:56 +01:00
Andreas Nedbal 56a1c70fae add `admin?` shorthand to users 2022-08-21 15:02:49 +02:00
Georg Gadinger 66efa5d4f4 clean up routes
- replace `match` with `get`/`post`/`patch`/`delete`
- format routes.rb
- rename the `show_user_{profile,question,answer}` routes to
  `profile`, `question`, `answer` so `url_for` (used by Rails Admin)
  works fine for these things
- also add `to_param` to the `User` model so that `url_for(some_user)`
  uses the user name
2022-07-23 12:14:06 +02:00
Andreas Nedbal cbd9106a87 Remove `ModerationComment` model, relations and methods 2022-07-19 11:17:45 +02:00
Andreas Nedbal e283648ce0 Remove `ModerationVote` model, relations and methods 2022-07-18 23:10:07 +02:00
Karina Kwiatek 539505eccd Ensure counters only get updated if the record exists 2022-07-06 20:58:53 +02:00
Karina Kwiatek e2462b1e51 Correct lint errors
(only on lines affected in this PR)
2022-07-06 20:58:53 +02:00
Karina Kwiatek e7112f0244 Use `dependent: :destroy_async` instead of `DeletionWorker` 2022-07-06 20:58:53 +02:00
Karina Kwiatek 0db369a9ae Remove comment_smiles relationship from users 2022-07-06 20:48:50 +02:00
Karina Kwiatek 0cfe5ee964 Replace usages of smiles with reaction appendables 2022-07-05 23:23:37 +02:00
Karina Kwiatek 5f0a546353 Refactor smiling answers to using reactions 2022-07-05 23:23:37 +02:00
Karina Kwiatek 53361eefdd Move ban-related user methods to own module 2022-06-26 18:32:18 +02:00
Karina Kwiatek 59c4507ec3 Remove unused use case requires from `User` model 2022-06-26 18:32:18 +02:00
Karina Kwiatek 73274988c1 Add `permanently_banned?` method to user model 2022-06-26 18:32:18 +02:00
Karina Kwiatek 34c747ebf7 Appease the dog overlords 2022-06-26 18:32:18 +02:00
Karina Kwiatek 3247d1c746 Move ban invalidation to `User#unban` method 2022-06-26 18:32:18 +02:00
Karina Kwiatek 94aec26588 Move ban creation to `User#ban` method 2022-06-26 18:32:18 +02:00
Karina Kwiatek 1e6243c6ce Create AnonymousBlock model 2022-06-15 14:26:48 +02:00
Karina Kwiatek b657894576 Prevent errors in `User#answer` when asking anonymous questions 2022-06-13 19:32:00 +02:00
Karina Kwiatek e64d4f3ca7 Prevent blocked users from reacting on comments 2022-06-13 11:56:34 +02:00
Karina Kwiatek 04243c2ec8 Appease the dog overlords 2022-06-13 11:56:34 +02:00
Karina Kwiatek 65309edd8f Add block checks into `User#answer` 2022-06-13 11:56:34 +02:00
Karina Kwiatek b38ae50ba7 Disallow reacting to an answer when blocked by its author 2022-06-13 11:56:34 +02:00
Karina Kwiatek b4e5037469 Disallow commenting when blocked by the answer's author 2022-06-13 11:56:34 +02:00
Karina Kwiatek 0038272417 Add Block relationship type 2022-06-13 11:56:34 +02:00
Karina Kwiatek 3962671135 Implement relationship logic as use case 2022-01-23 16:48:53 +01:00
Karina Kwiatek ce951453a2 Make relationships polymorphic 2022-01-23 16:48:53 +01:00
Georg Gadinger 29923fac84 add validator for typoed emails
It happens quite often that people typo their email address (I blame
phone keyboards for that).  Catch common cases in a validator and
tell the user that they have a typo in their email.

Why yes, I did write the tests for this first, thanks for asking!
2022-01-11 19:18:23 +01:00
Karina Kwiatek b398265a98 Address review comments from @nilsding
Co-authored-by: Georg Gadinger <nilsding@nilsding.org>
2022-01-06 13:59:04 +01:00
Karina Kwiatek 7677ed21a4 Update tests for unbanning users 2022-01-02 19:50:44 +01:00
Karina Kwiatek a9392dad53 Use use case for `User#unban` 2022-01-02 19:50:44 +01:00
Karina Kwiatek 6500d7ac71 Update usages of bans 2022-01-02 19:50:44 +01:00
Karina Kwiatek ea62d91014 Make ban UI more intuitive when a user is already banned 2022-01-02 19:50:02 +01:00
Karina Kwiatek 9a35584284 Refactor ban-related functionality into use cases 2022-01-02 19:50:01 +01:00
Karina Kwiatek be0cf69368 Refactor existing ban-related methods 2022-01-02 19:50:01 +01:00
Karina Kwiatek e4241d2001 Create user ban model
Co-authored-by: Georg Gadinger <nilsding@nilsding.org>
2022-01-02 19:50:01 +01:00
Karina Kwiatek 18de468198 Add inverse relationship for mute rules <-> users 2022-01-01 00:38:38 +01:00