Commit graph

391 commits

Author SHA1 Message Date
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
Karina Kwiatek
9d1e77aeba Revoke Twitter connection when the token is revoked 2023-01-01 23:46:10 +01:00
Andreas Nedbal
9b5470cfd3 Appease the dog overlords 2023-01-01 22:43:24 +01:00
Andreas Nedbal
7b0a615193 Validate uniqueness of answers for questions 2023-01-01 22:43:24 +01:00
Andreas Nedbal
6700a52ad1 Remove superfluous require 2023-01-01 22:42:50 +01:00
Andreas Nedbal
6a03d3587a Appease the dog overlords 2023-01-01 22:42:50 +01:00
Andreas Nedbal
55c473e0f5 don't create notifications from muted user 2023-01-01 22:42:50 +01:00
Andreas Nedbal
2a7a17a4c3 wip: don't create notifications from a muted user 2023-01-01 22:42:50 +01:00
Andreas Nedbal
361b8df798 Add mute relationship and user methods 2023-01-01 22:42:50 +01:00
Georg Gadinger
fb07eda972 remove errors 2022-12-29 20:57:28 +01:00
Andreas Nedbal
e7f60acad5 Add target_user field to anonymous blocks 2022-12-28 00:10:59 +01:00
Andreas Nedbal
5a0e42fe66 use has_cached_role? instead of has_role? 2022-12-18 21:47:03 +01:00
Georg Gadinger
e1bdb1324f make the export worker create a *real* notification and add specs for it 2022-12-10 04:25:08 +01:00
Andreas Nedbal
41c43538b5 Fix lints 2022-11-21 20:26:19 +01:00
Karina Kwiatek
40d5dc41dd Ensure mute rules cannot be empty 2022-11-21 20:26:19 +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
Karina Kwiatek
ae5d8931af Implement frontend for blocking users site-wide 2022-08-20 19:03:05 +02:00
Karina Kwiatek
0bbb435858 Allow anonymous blocks without an owner 2022-08-20 19:02:37 +02:00
Andreas Nedbal
bdb637047b Omit hash value in question methods 2022-07-24 22:27:15 +02:00
Andreas Nedbal
4f4e6c83a1 Do not decrement the question count if the question is direct 2022-07-24 22:25:13 +02:00
Andreas Nedbal
83dbd5d2e3 Don't list direct questions on user profiles 2022-07-24 21:56:03 +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
Karina Kwiatek
81b73d5196 Replace options hash with keyword arguments 2022-07-22 16:52:42 +02:00
Karina Kwiatek
b534dc0bb8 Fix CommentSmile notification type not being returned 2022-07-22 16:52:42 +02:00
Karina Kwiatek
6089c57a20 Appease the dog overlords 2022-07-22 16:52:42 +02:00
Karina Kwiatek
691f72d0ce Set notification type for reactions based on what the reaction is attached to 2022-07-22 16:52:42 +02:00
Karina Kwiatek
0992d44aef Filter notifications by target type 2022-07-22 16:52:42 +02:00
Karina Kwiatek
f475cd0a0b Make notifications relation polymorphic 2022-07-22 16:52:42 +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
4f88b82361 Use null-safe navigation for denotify 2022-07-17 21:21:37 +02:00
Karina Kwiatek
5d542161a0 Add tests for question create use case 2022-07-17 10:05:20 +02:00
Karina Kwiatek
d9ff4d5765 Refactor Ajax::QuestionController#create into separate UseCases
Co-authored-by: Georg Gadinger <nilsding@nilsding.org>
2022-07-17 10:05:20 +02:00
Andreas Nedbal
47120e8d24 Appease the dog overlords 2022-07-17 09:40:34 +02:00
Andreas Nedbal
a3f80380dd Adjust validations for List 2022-07-17 09:40:34 +02:00
Karina Kwiatek
8005fc8ae6 Skip denotify if recipient doesn't exist 2022-07-16 21:29:20 +02:00
Karina Kwiatek
28240bba27 Properly match notification type 2022-07-09 01:15:31 +02:00
Karina Kwiatek
8a6a9c21ec Appease the dog overlords
These counters are legacy and will later be removed.
2022-07-06 20:58:53 +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
c0dbc7d501 Always denotify when deleting reactions 2022-07-06 20:43:01 +02:00
Karina Kwiatek
9bcf1a80ad Merge author_name with author_identifier 2022-07-06 19:56:04 +02:00
Karina Kwiatek
561946cab9 Fix issues from bad rebase 2022-07-05 23:23:37 +02:00
Karina Kwiatek
22ec4db349 Remove Smile & CommentSmile 2022-07-05 23:23:37 +02:00
Karina Kwiatek
08e5764bf3 Appease the dog overlords 2022-07-05 23:23:37 +02:00
Karina Kwiatek
5ba3fed56c Replace usage of answer in before_destroy of Reaction with parent 2022-07-05 23:23:37 +02:00
Karina Kwiatek
f9ec11a616 Use .class.name for target_type in Notification#make_notification 2022-07-05 23:23:37 +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
1e53f00032 Add migration for converting smiles to reaction appendable 2022-07-05 23:23:37 +02:00
Karina Kwiatek
544e9c8fa6 Create Appendable model 2022-07-05 23:23:37 +02:00
Karina Kwiatek
32865b528d Highlight current ban 2022-07-02 17:08:44 +02:00
Karina Kwiatek
a857887398 Appease the dog overlords 2022-06-26 18:32:18 +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
0c6d79ce0b Add permanent? method to UserBan 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
483c413796 Remove unused user relationship paginators 2022-06-18 17:50:41 +02:00
Karina Kwiatek
e404b61ec1 Sort relationship lists by relationship IDs rather than user IDs 2022-06-18 17:50:41 +02:00
Karina Kwiatek
cca8795b01 Allow anonymous questions to be returned when the user has disabled anonymous questions
Fixes #267
2022-06-15 17:49:04 +02:00
Karina Kwiatek
e660b731d7 Appease the dog overlords 2022-06-15 14:26:48 +02:00
Karina Kwiatek
4e80b4f9ab Prevent anon questions from being sent while blocked 2022-06-15 14:26:48 +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
14e84fd47c Prevent errors when asking anonymous questions 2022-06-13 16:12:06 +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
e9fa3b83b2 Fix mixed up block handling in follow method 2022-06-13 11:56:34 +02:00
Karina Kwiatek
c173c4a17d Add the ability to block/unblock users from profile pages 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
bd0a4532a5 Disallow answering questions when blocked by its 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
b4e0699e82 Fix lint errors 2022-01-23 16:48:53 +01:00
Karina Kwiatek
3962671135 Implement relationship logic as use case 2022-01-23 16:48:53 +01:00
Karina Kwiatek
d20e07ee19 Remove relationship counters in users table 2022-01-23 16:48:53 +01:00
Karina Kwiatek
ce951453a2 Make relationships polymorphic 2022-01-23 16:48:53 +01:00
Karina Kwiatek
45854894dc Upgrade to Rails 6.0 2022-01-13 21:42:06 +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
d3aaaeb12d
Double question character limit (#292) 2022-01-10 22:01:47 +01:00
Karina Kwiatek
136e2fa016
Merge pull request #272 from Retrospring/feature/social-post-tagging
Add the ability to post to services with a tag
2022-01-07 19:40:52 +01:00
Karina Kwiatek
96e48a833b
Merge pull request #194 from Retrospring/refactor/user-bans
Implement ban history
2022-01-06 14:05:33 +01:00
Karina Kwiatek
75d24db1b9
Merge pull request #269 from Retrospring/feature/mod-pagination
Pagination in moderation panel
2022-01-06 14:05:12 +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
683fffd734 Add the ability to post to services with a tag 2022-01-05 19:49:59 +01:00
Georg Gadinger
3c58257d21 remove tumblr
Resolves #274
2022-01-05 19:32:52 +01:00
Karina Kwiatek
2cab96b9af Implement cursored pagination in Moderation Panel 2022-01-03 22:43:37 +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
249438e5a8 Escape muted strings 2022-01-01 00:38:38 +01:00
Karina Kwiatek
18de468198 Add inverse relationship for mute rules <-> users 2022-01-01 00:38:38 +01:00
Karina Kwiatek
f85769eb55 Add mute rules 2022-01-01 00:38:36 +01:00
Karina Kwiatek
0da070c5ff Move includes into cursored_friends/cursored_followers 2021-12-31 15:35:02 +01:00
Karina Kwiatek
32e6975c28 Include smiles when eager loading answers 2021-12-30 23:21:46 +01:00
Karina Kwiatek
7357e92865 Eager load relationships for questions, answers and users 2021-12-30 22:15:59 +01:00
Andreas Nedbal
4529fa0d18 Fix Services::Tumblr not being able to post 2021-12-27 14:28:11 +01:00
Andreas Nedbal
7be52bb7f2 Include Rails URL helpers in Services::Twitter 2021-12-26 22:17:53 +01:00
Andreas Nedbal
ed64a0990e Move tumblr post formatting into a separate helper class 2021-12-26 22:04:46 +01:00
Andreas Nedbal
b64b039d21 Move tweet formatting into a separate helper class 2021-12-26 22:04:16 +01:00
Karina Kwiatek
053ebafbc5
Merge pull request #213 from Retrospring/refactor/profile
Move profile fields to seperate table
2021-12-25 22:44:10 +01:00
Karina Kwiatek
7f26c1fef3 Ensure elipsis character always gets added for long questions/answers 2021-12-25 22:08:06 +01:00
Karina Kwiatek
61c8208e26 Ensure tweets fit twitter's length limit 2021-12-25 13:39:35 +01:00
Karina Kwiatek
842f51d745 Replace remaining usages of user.display_name 2021-12-23 22:01:56 +01:00
Karina Kwiatek
00496a1596 Update remaining references to profile fields 2021-12-22 00:03:19 +01:00
Karina Kwiatek
ff410773dd Create Profile model 2021-12-22 00:03:18 +01:00
Karina Kwiatek
d27ae910c2 Adjust theme-color for mobile layout 2021-08-12 00:37:47 +02:00
Karina Kwiatek
6b32bddc76 Order relationships by their creation date
Closes #115
2021-08-11 17:09:04 +02:00
Karina Kwiatek
7249e45989 Add tests for user_twitter_card and answer_opengraph 2021-08-06 21:38:51 +02:00
Dominik Kwiatek
277799ff4b Remove TotpRecoveryCode.remove_all_for(user) method 2020-11-15 22:09:27 +01:00
Dominik Kwiatek
aeb1396422 Add tests for recovery codes 2020-11-15 10:21:06 +01:00
Dominik Kwiatek
b4f479a00f Generate recovery keys on TOTP setup 2020-11-01 17:55:31 +01:00
Dominik Kwiatek
25410e111d Fix OTP auth triggering for users who haven't set it up
I thought I could be clever by using a null secret key as an indicator of it being disabled
2020-10-18 11:39:28 +02:00
Dominik Kwiatek
141ff59f63 Implement Two Factor Authentication 2020-10-18 10:39:46 +02:00
Georg Gadinger
ea0685136e Rename Groups to Lists
haha regexp go brrr

special thanks to @seatsea for helping me out with the French locales
2020-05-25 18:04:54 +02:00
Dominik M. Kwiatek
d4f8e03d28 Cropping in the background
With database fields, sadly.
2020-05-17 20:39:10 +01:00
Dominik M. Kwiatek
d185c54f03 Add CarrierWave Backgrounder 2020-05-17 20:38:40 +01:00
Karina Kwiatek
ff9741589d Implement cropping; make uploaders DRY 2020-05-17 20:38:40 +01:00
Karina Kwiatek
783e47fc2b Replace paperclip with CarrierWave 2020-05-17 20:38:40 +01:00
Andreas Nedbal
880429f5f9 Add new fields for themes
- In the settings view
- In the model validation
- In the controller parameter permissions
- In the CoffeeScript/Ruby helpers
2020-05-05 02:02:16 +02:00
Andreas Nedbal
53979580d8 Merge branch 'master' into feature/bootstrap 2020-05-04 23:19:54 +02:00
Andreas Nedbal
02cc1c418d WIP: Initial implementation of CSS variable based theming 2020-05-03 17:28:41 +02:00
Georg Gadinger
dd5f718f31 Question: user association is optional 2020-05-01 10:17:05 +02:00
Georg Gadinger
aeef50ad78
Merge pull request #86 from Retrospring/cleanup
Minor Cleanup
2020-04-26 20:03:46 +02:00
Georg Gadinger
445d9ebe2a Fix user questions page 2020-04-23 03:31:07 +02:00
Karina Kwiatek
3aa2e5899c Remove JoJoke 2020-04-22 15:51:45 +01:00
Georg Gadinger
101b3b68d3 Use cursored pagination, remove WillPaginate 2020-04-20 23:13:24 +02:00
Dominik M. Kwiatek
516bc48aa0
Merge pull request #70 from Retrospring/feature/announcements
Implement Announcements
2020-04-19 23:10:47 +01:00
Georg Gadinger
477ec3e9c9 Do not allow creation of groups with empty names 2020-04-19 23:28:50 +02:00
Karina Kwiatek
391f4a28ed Merge branch 'master' into feature/announcements
# Conflicts:
#	db/schema.rb
2020-04-19 21:52:58 +01:00
Karina Kwiatek
b6d6c1fded Add announcements to the top of the application template 2020-04-19 21:38:21 +01:00
Georg Gadinger
946bb3ae9d Use Rolify for admin and moderator roles 2020-04-19 22:35:58 +02:00
Karina Kwiatek
2ecc746e23 Implement validation for announcements 2020-04-19 21:11:22 +01:00
Karina Kwiatek
e3b89f7346 Implement creation of announcements 2020-04-19 20:34:48 +01:00
Karina Kwiatek
8a632a09cd Create Announcement model & controller 2020-04-19 20:12:22 +01:00
Georg Gadinger
3e7497a144 Upgrade to Rails 5 2020-04-19 00:59:22 +02:00
Andreas N
7a16113295 adjust tweet length to new twitter limit 2018-04-11 21:26:58 +02:00
Georg G
39c79287e2 ing hell 2016-01-05 21:50:21 +01:00