Commit graph

5231 commits

Author SHA1 Message Date
Dessalines
5fa6a490d5
Create actions structs (#5482)
* migration

* update code

* tests

* triggers

* fix

* fmt

* clippy

* post aggregate migration

* changes for post aggregate code

* wip: update tests for post aggregate

* format

* fix partialeq

* trigger fix

* fix post insert trigger

* wip

* reorder

* fixes

* community aggregate migration

* update code

* triggers

* person aggregate migration

* person aggregate code

* person triggers

* test fixes

* fix scheduled task

* update api tests

* site_aggregates to local_site migration

* site_aggregates code changes

* triggers, tests

* more fixes

* Rename PersonPostAggregates to PostActions

* Merge local_user_vote_display_mode into local_user

* fix schema

* remove duplicate fields

* remove "aggregates" from index names

* uncomment indices

* if count = 0

* remove commentaggregates

* Fix triggers in remove aggregates tables pr (#5451)

* prevent all db_schema test errors

* fix the delete_comments_before_post problem in a way that doesn't affect the returned number of affected rows

* remove unnecessary recursion checks and add comment to remaining check

* clean up

* Fixing SQL format.

* Update triggers.sql

* Update triggers.sql

* Update triggers.sql

* Update triggers.sql

* remove update of deleted column

---------

Co-authored-by: Dessalines <tyhou13@gmx.com>

* rename migration

* Fix migration errors

* Move community.hidden to visibility (fixes #5458)

* Fixing person_saved_combined. (#5481)

* Remove comment and post specific action structs. #5473

* Doing reports

* fix up migration by dropping index

* also add enum variant `LocalOnlyPublic`, rename `LocalOnly` to `LocalOnlyPrivate`

fixes #5351

* fix column order in down.sql

* wip

* Moving blocks.

* Adding a few more views.

* more wip

* fixes

* migration for modlog

* fix migration

* Working views and schema.

* Fix ts_optionals.

* wip

* db_schema compiling

* make the code compile

* Merging from main.

* lint

* Fixing SQL format.

* fix down migration

* Fixing api tests.

* Adding field comments for the actions tables.

* Refactoring CommunityFollower to include follow_state

* fix test

* make hidden status federate

* ts attr

* fix

* fix api test

* Update crates/api/src/reports/post_report/resolve.rs

Co-authored-by: Nutomic <me@nutomic.com>

* Addressing PR comments

* Fix ts export.

* update api client

* review

* Extracting filter_not_hidden_or_is_subscribed (#5497)

* Extracting filter_not_hidden_or_is_subscribed

* Cleanup.

* Cleanup 2.

* Remove follower_state_helper function.

* Cleaning up some utils functions.

* rename hidden to unlisted

---------

Co-authored-by: Felix Ableitner <me@nutomic.com>
Co-authored-by: dullbananas <dull.bananas0@gmail.com>
2025-03-12 11:51:34 -04:00
Nutomic
8ffeeca52d
Changes to community visibility (#5478)
* Move community.hidden to visibility (fixes #5458)

* fix up migration by dropping index

* also add enum variant `LocalOnlyPublic`, rename `LocalOnly` to `LocalOnlyPrivate`

fixes #5351

* fix column order in down.sql

* wip

* more wip

* fixes

* migration for modlog

* fix migration

* wip

* db_schema compiling

* make the code compile

* lint

* fix down migration

* fix test

* make hidden status federate

* ts attr

* fix

* fix api test

* update api client

* review

* Extracting filter_not_hidden_or_is_subscribed (#5497)

* Extracting filter_not_hidden_or_is_subscribed

* Cleanup.

* Cleanup 2.

* rename hidden to unlisted

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2025-03-12 09:45:02 -04:00
dullbananas
d93bfdd2fa
Update user count from local_user table instead of person table, and only count users with accepted application (#5495)
* Update user count from local_user instead of person, and only count users with accepted application

* fix

* Update up.sql

* Update down.sql
2025-03-11 16:37:40 +01:00
Nutomic
b6f46cd38c
When creating community copy allowed languages from creator profile (#5490) 2025-03-11 09:53:41 -04:00
Dessalines
bb82e5dd43
Register users in a transaction. (#5480)
* Register users in a transaction.

- Fixes #5477

* Removing transactions from language code.

* Replace build_transactions with async transactions.

* Forgot one transaction.
2025-03-11 10:39:48 +01:00
Dessalines
91d10092b6
Adding pagination for GetBannedPersons (#5428)
* Extracting pagination cursor utils into a trait.

- Fixes #5275

* Refactoring to avoid stack overflows.

* Fixing api_common feature.

* Adding pagination for GetBannedPersons.

- Must come after #5424
- Fixes #2847

* Rename the traits and paginationcursor::new

* Using combined trait.

* Removing empty files.

* Merge from main, limit fetch.

* Adding local ban check, and ignore_page_limits.

* Only do page limits if not admin.
2025-03-11 09:41:02 +01:00
Nutomic
304df35f3b
Only enable English for users on instances with all languages enabled (ref #5489) (#5493) 2025-03-11 09:38:47 +01:00
Nutomic
96e4621cb8
Dont force enable undetermined language anymore (fixes #5487) (#5491)
* Dont force enable undetermined language anymore (fixes #5487)

* fix test
2025-03-10 11:52:35 -04:00
Nutomic
3dfb0cab36
Speedup generation of RSA keys in debug mode (#5494) 2025-03-10 11:41:43 -04:00
dullbananas
c315145146
Make post id indexed again (#5492) 2025-03-10 10:33:21 -04:00
dullbananas
08defa29fe
Add community reports to API (#5435)
* add routes

* implement some of api

* fix use of check_report_reason

* fix create_community_report

* fix all compile errors

* add field to reportcombined struct

* add CommunityReportView::read test

* import resolve_community_report

* remove references to deleted table

* resolve reports after remove
2025-03-10 09:37:50 -04:00
vaskebjoern
b8de9a518b
Added display of image files to post description. (#5488) 2025-03-07 21:29:55 -05:00
Nutomic
85a4071a5c
Enable english for all users in db migration (#5489) 2025-03-07 08:44:23 -05:00
Nutomic
9a64902ace
Remove aggregate tables (fixes #4869) (#5407)
* migration

* update code

* tests

* triggers

* fix

* fmt

* clippy

* post aggregate migration

* changes for post aggregate code

* wip: update tests for post aggregate

* format

* fix partialeq

* trigger fix

* fix post insert trigger

* wip

* reorder

* fixes

* community aggregate migration

* update code

* triggers

* person aggregate migration

* person aggregate code

* person triggers

* test fixes

* fix scheduled task

* update api tests

* site_aggregates to local_site migration

* site_aggregates code changes

* triggers, tests

* more fixes

* Rename PersonPostAggregates to PostActions

* Merge local_user_vote_display_mode into local_user

* fix schema

* remove duplicate fields

* remove "aggregates" from index names

* uncomment indices

* if count = 0

* remove commentaggregates

* Fix triggers in remove aggregates tables pr (#5451)

* prevent all db_schema test errors

* fix the delete_comments_before_post problem in a way that doesn't affect the returned number of affected rows

* remove unnecessary recursion checks and add comment to remaining check

* clean up

* Fixing SQL format.

* Update triggers.sql

* Update triggers.sql

* Update triggers.sql

* Update triggers.sql

* remove update of deleted column

---------

Co-authored-by: Dessalines <tyhou13@gmx.com>

* rename migration

* Fix migration errors

* Fixing person_saved_combined. (#5481)

---------

Co-authored-by: dullbananas <dull.bananas0@gmail.com>
Co-authored-by: Dessalines <tyhou13@gmx.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2025-03-06 16:18:41 +01:00
Nutomic
7b86307760
Ignore accept-language header if not site languages are specified (#5485) 2025-03-06 09:34:20 -05:00
Nutomic
b14c6ae0ee
Add more options for image uploads (#5483)
* Add more options for image uploads

* remove separate option for animations

* add comment
2025-03-06 04:44:52 -05:00
Nutomic
1e02dea397
Use connection url to configure email (fixes #5472) (#5476)
* Use connection url for configure email (fixes #5472)

* clippy
2025-03-04 13:50:19 -05:00
Dessalines
a6507c169d
Extracting pagination cursor utils into a trait. (#5424)
* Extracting pagination cursor utils into a trait.

- Fixes #5275

* Refactoring to avoid stack overflows.

* Fixing api_common feature.

* Rename the traits and paginationcursor::new

* Using combined trait.

* Removing empty files.
2025-03-04 13:00:18 -05:00
flamingos-cant
2f2f58da65
Add HTML classes to mention (#5475) 2025-03-04 09:31:44 -05:00
Dessalines
03630c8abd
Direct questions to lemmy.ml/c/lemmy_support. #5464 (#5467)
* Direct questions to lemmy.ml/c/lemmy_support. #5464

* Add matrix chat.
2025-03-04 09:50:53 +01:00
Nutomic
62fb03599a
Use version from git to indicate unreleased changes (#5470) 2025-03-03 10:55:33 -05:00
Nutomic
97772b9553
Add config option to enable json logging (#5471) 2025-03-03 10:51:28 -05:00
flamingos-cant
e7ab5256f7
Add new setting to block NSFW content (#5436)
* Block NSFW content on instances with it disabled

* Make disallow_nsfw_content a local_site setting

* Clippy

* Add comma

* SQL fmt

* Newline

* Use func in apub + update js-client

* Remove extra db queries, add purge_post_images

* Add back local_site to funcs that need it

* Fix tests

* Add delay to api test

* Address comments

* Cleanup

* Return results from db func

* fmt

* Remove unneeded result

* Sync translations
2025-03-03 11:46:39 +01:00
renovate[bot]
be91a2f39c
Update Rust crate anyhow to v1.0.96 (#5465)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-28 21:09:53 -05:00
renovate[bot]
0f9aab4143
Update Rust crate chrono to v0.4.40 (#5466)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-28 21:09:03 -05:00
Nutomic
359942272a
Get rid of Option<Vec<_>> in api structs (fixes #2820) (#5463)
* Get rid of `Option<Vec<_>>` in api structs (fixes #2820)

* update js client

* only responses
2025-02-28 10:07:07 -05:00
Felix Ableitner
253230a5cb Run cargo check after updating translations to catch errors 2025-02-28 14:39:10 +01:00
Felix Ableitner
cd1da33fa1 Version 1.0.0-alpha.2 2025-02-28 14:33:44 +01:00
Felix Ableitner
0ad8466f06 Version 1.0.0-alpha.1 2025-02-28 14:18:28 +01:00
Nutomic
a3a988655d
Fix federation of unban action (fixes #5454) (#5456)
* Fix federation of unban action (fixes #5454)

* remove log
2025-02-28 08:09:19 -05:00
Nutomic
6e3355f941
Also search url field by default (#5459) 2025-02-28 08:08:55 -05:00
Draconic NEO
1a299ba628
Include image alt text in post search (#5449)
* Add Alt-Text Filter to post_view.rs

Added Alt-text filter to search

* Actually use the Alt-text filter I added

Add the call to actually use the alt-text filter I added.

* Create down.sql of migration

* Create up.sql

* Fixing SQL format.

---------

Co-authored-by: Dessalines <tyhou13@gmx.com>
2025-02-25 13:28:15 -05:00
Nutomic
493734d1b3
Show posts/comments from followed communities despite instance block (#5437)
* Show posts/comments from followed communities despite instance block (fixes #4303)

* move to utils
2025-02-20 17:18:38 -05:00
Nutomic
544a4cc039
Simplify slur regex (#5442)
* Simplify logic for slur regex

* Fix tests

* clippy

* fix test

* cache regex

* longer cache duration
2025-02-20 12:47:18 -05:00
Nutomic
510b0db869
Deleted user shouldnt break federation outbox (fixes #5441) (#5443)
* Deleted user shouldnt break federation outbox (fixes #5441)

* clippy
2025-02-20 12:46:36 -05:00
Dessalines
7f0ef4d7f4
Fix matrix id import. #5063 (#5440) 2025-02-20 09:29:07 +01:00
Nutomic
a65d4034d8
Reduce usage of async_trait (#5438)
* Reduce usage of async_trait

* use trait

* move dep
2025-02-19 11:06:22 -05:00
Dessalines
806f541fe5
Add ability to view your own sent reports. (#5427)
- Fixes #5108
2025-02-16 11:32:29 -05:00
Nutomic
d1eff9084b
Rate limit changes (fixes #5287) (#5421)
* Stricter rate limit for fetching link metadata (fixes #5287)

* Switch to search rate limit

* use search rate limit for resolve object

* pictrs rate limit

* undo test change

* fix
2025-02-14 07:36:16 -05:00
Dessalines
a4bf28e123
Use rust:1.81 for CI. (#5423)
* Use rust:1.81 for CI.

- Should speed up CI jobs a lot, due to the diesel issues with 1.82+.

* Upgrading deps.
2025-02-13 09:51:42 +01:00
Nutomic
0e87900953
Allow sending report only to admins (fixes #2414) (#5350)
* Allow sending report only to admins (fixes #2414)

* fix api test

* Rename `to_local_admins` to `violates_instance_rules`

* Review fixes

* fix api test
2025-02-12 16:34:43 +01:00
Dessalines
ae9c735e90
Adding ability to resend verification email. (#5420)
* When verifying email, add note about waiting for approval.

- Fixes #5392

* Refactoring local user interface language.

* Removing rosetta from api common.

* Remove pointless Ok

* Add ability to resend verification email.

- Fixes #5191

* Forgot to commit file.

* Fixing bad merge.

* Using send_verification_email_if_required.
2025-02-12 10:21:34 -05:00
Dessalines
189491d1ca
Show comments for hidden communities. (#5417)
- Fixes #5390
2025-02-12 08:05:14 -05:00
Dessalines
c71e2a2195
When verifying email, add note about waiting for approval. (#5419)
* When verifying email, add note about waiting for approval.

- Fixes #5392

* Refactoring local user interface language.

* Removing rosetta from api common.

* Remove pointless Ok
2025-02-12 07:45:25 -05:00
Nutomic
0af973c3a2
Also remove private messages when banning user with "remove content" (#5414)
* Also remove private messages when banning user with "remove content"

* add private message removed

* fix formatting
2025-02-12 07:45:07 -05:00
Nutomic
7c7e482936
Ignore follow requests from kbin, mbin for private communities (#5416)
These platforms dont support privacy controls for votes, so they
will most likely leak the content of private communities as well.
Need to block them until support is implemented.

https://github.com/MbinOrg/mbin/issues/1115
2025-02-11 10:24:10 -05:00
Dessalines
91a77ae456
Adding a can_mod field to CommentView, PostView, and CommunityView. (#5398)
* Adding a can_mod field to CommentView, PostView, and CommunityView.

- Also removes the moderators from GetPost, as that should no longer
  be necessary.
- Fixes #4365

* Adding can_mod to reply variants.

* Addressing PR comments.

* Hiding comment.content for non-admins / mods.

- Uses the local_user_can_mod function now.
- Fixes #5232
2025-02-11 12:09:27 +01:00
Dessalines
426684d90f
Adding blurhash to image_details. (#5227)
* Adding blurhash to image_details.

- Fixes #5142

* Using new pictrs to get blurhash.

* Fixing ts-binding.

* Addressing PR comments.

* Commenting checks.

* Switching back to rust 1.81.

* Adding diesel schema

* Adding database user creation.

* Specific tests.

* Upping pictrs to 0.5.17-pre.9

* Fixing

* Using full tests.

* Fixing pictrs hash.

* Upgrading pnpm deps.
2025-02-10 17:27:22 -05:00
Dessalines
16ba42c152
Adding a variable time_range_limit, rather than having many post sorts like TopSixHours (#5403)
* Adding a variable time_range_seconds. #4340

* Adding default_post_time_range_seconds columns to local_user and site.

* Fixing ts-bindings.

* Fixing API comments.

* Update crates/db_schema/src/utils.rs

Co-authored-by: dullbananas <dull.bananas0@gmail.com>

* Add zero means override, to list_posts default time range.

---------

Co-authored-by: dullbananas <dull.bananas0@gmail.com>
2025-02-10 22:41:20 +01:00
Nutomic
56ed92ca92
Fix hash check for pictrs binary (#5411) 2025-02-10 14:22:24 -05:00