Commit graph

5373 commits

Author SHA1 Message Date
Nutomic
546372b163
Fix post listing in nsfw communities (fixes #5685) (#5699) 2025-05-20 10:49:18 -04:00
Anton Boitsov
9267b50bd7
Deleting local image from db only if pict-rs client returned OK (fixes #5671) (#5680)
* Deleting local image only if pict-rs client returned OK (fixes #5671)

* Adding validation of image, and making some refactoring

* fmt fix

* removed unnecessary validations

* Increase max query duration in PostView speed_check

* TypeScript type CommunityIdQuery for community icon/banner uploads (#5679)

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

* Add list of local user accounts for admins (fixes #4419) (#5668)

* Add list of local user accounts for admins (fixes #4419)

* add api route

* Merge list_banned_users into admin_list_users

* revert sql

* Optional columns are handled correctly in insert and update forms (ref #5672) (#5675)

* Optional columns are handled correctly in insert and update forms (ref #5672)

* Linter fix

* Downscale proxied thumbnails (fixes #5673) (#5674)

* Downscale proxied thumbnails (fixes #5673)

* add param

* fix tests

* Remove some api_common dependencies (ref #5642) (#5678)

* Adding validation of image, and making some refactoring

* fmt fix

* removed unnecessary validations

---------

Co-authored-by: aboitsov <anton.boitsov@zalando.fi>
Co-authored-by: Felix Ableitner <me@nutomic.com>
Co-authored-by: matc-pub <161147791+matc-pub@users.noreply.github.com>
Co-authored-by: Dessalines <tyhou13@gmx.com>
2025-05-19 16:48:56 -04:00
Dessalines
68008a0e2c
Change local_image to reference person_id, to track thumbnail creators. (#5664)
* Migrations before column fixes

* Change local_image to reference person_id, to track thumbnail creators.

- Fixes #5564

* Fixing API tests.

* Increase the post query duration time. #5661

* Adding thumbnail_and_post_id column

* Forgot ts-optional

* Fixing post spec tests.

* Try using promise.allSettled to ignore errors.

* Using consistent pictrs api key.

* Dont fetch thumbnails for user API.

* Dont delete thumbnails for user deletion.

* Dont filter out thumbnail images when fetching or deleting.

* Update crates/api_common/src/utils.rs

Co-authored-by: Richard Schwab <gitrichardschwab-7a2qxq42kj@central-intelligence.agency>

* Addressing PR comments

* Add comment.

* Rename to thumbnail_for_post_id

* Addressing PR comments

---------

Co-authored-by: Richard Schwab <gitrichardschwab-7a2qxq42kj@central-intelligence.agency>
2025-05-19 15:30:02 -04:00
Nutomic
c840c9b2ae
Deny as conversions (#5688)
* Deny `as` conversions

* comment
2025-05-15 10:31:23 -04:00
Felix Ableitner
8c0a0c9b8f Adjust comments in image api test 2025-05-15 14:32:58 +02:00
Dessalines
20e9f5c504
Order vote view tie-breaker to use like published time. (#5683)
- #5676
2025-05-15 10:13:36 +02:00
Nutomic
17720ec5fa
Remove some api_common dependencies (ref #5642) (#5678) 2025-05-13 14:26:16 -04:00
Nutomic
542d267e4e
Downscale proxied thumbnails (fixes #5673) (#5674)
* Downscale proxied thumbnails (fixes #5673)

* add param

* fix tests
2025-05-13 14:24:11 -04:00
Anton Boitsov
3421754ad8
Optional columns are handled correctly in insert and update forms (ref #5672) (#5675)
* Optional columns are handled correctly in insert and update forms (ref #5672)

* Linter fix
2025-05-13 14:22:56 -04:00
Nutomic
3d6dad4afc
Add list of local user accounts for admins (fixes #4419) (#5668)
* Add list of local user accounts for admins (fixes #4419)

* add api route

* Merge list_banned_users into admin_list_users

* revert sql
2025-05-13 10:27:42 -04:00
matc-pub
0263acd58b
TypeScript type CommunityIdQuery for community icon/banner uploads (#5679)
Co-authored-by: Nutomic <me@nutomic.com>
2025-05-13 04:47:03 -04:00
Felix Ableitner
7cbf8652e5 Increase max query duration in PostView speed_check 2025-05-13 10:21:58 +02:00
Nutomic
6b745f2113
lemmy_federate should not depend on lemmy_apub (ref #5614) (#5667)
* Move db_views crates into subfolder

* fix tests

* try fix ci

* absolute path

* Move db_views crates into subfolder

* lemmy_federate should not depend on lemmy_apub (ref #5614)

* taplo

* fix ci

* add comment

* use value
2025-05-12 13:08:32 +02:00
Dessalines
18a042fb62
Adding reason for mod_lock_post. (#5670)
* Adding reason for mod_lock_post.

- Fixes #5631

* Fix comment.
2025-05-09 09:40:06 -04:00
Dessalines
49f4a8b25c
Remove api v3 routes. #5508 (#5516) 2025-05-08 12:57:36 -04:00
Nutomic
0d4c7c9261
Add comments for site/instance (#5666) 2025-05-08 11:31:38 -04:00
Nutomic
f732c8949b
Split apub code into multiple crates (ref #5614) (#5663)
* Move db_views crates into subfolder

* fix tests

* try fix ci

* absolute path

* Move db_views crates into subfolder
2025-05-08 10:50:08 -04:00
Felix Ableitner
58ea201a3a Add comment for git_version 2025-05-08 10:13:30 +02:00
Nutomic
25a78d5eb6
Avoid constant rebuilding due to git version (#5665) 2025-05-07 16:23:36 -04:00
Nutomic
f0a0036ab5
Move db_views crates into subfolder (#5662)
* Move db_views crates into subfolder

* fix tests
2025-05-07 05:05:52 -04:00
renovate[bot]
ae95830137
Update docker (#5656)
* Update docker

* keep rust version

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nutomic <me@nutomic.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2025-05-06 09:33:25 +02:00
Dessalines
d047310633
Only remove email on account deletion, if the user wasn't banned. (#5650)
* Allow deleted / banned users to be able to log in, and delete their data.

- Fixes #3973

* Only delete email if local user isnt banned.

- Fixes #5629
2025-05-05 12:53:41 +02:00
Dessalines
8a6e621633
Adding ability to show downvotes for other users only. (#5644)
* Adding ability to show downvotes for other users only.

- Fixes #5639

* Forgot to add migrations

* Changing default back to Show.
2025-05-05 05:58:55 -04:00
renovate[bot]
5e19b8b704
Update npm to v8.31.1 (#5657)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-30 23:28:42 -04:00
xaeg
bd26d7f870
Show NSFW content by default if content_warning exists (#5654)
* Show NSFW content by default if content_warning exists

* Update crates/api_crud/src/community/list.rs

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

* Update list.rs

---------

Co-authored-by: Nutomic <me@nutomic.com>
2025-04-30 09:11:36 -04:00
Dessalines
457e1285a2
Fixing post_view largest community prefetch. (#5647)
* Fixing post_view largest community prefetch.

- Fixes #5621

* Cache the largest community result.

* Fixing community largest cache.

* Use cache duration

* Use 1-day cache for largest community
2025-04-30 09:10:08 -04:00
Dessalines
92663fd27d
Allow deleted / banned users to be able to log in, and delete their account. (#5643)
* Allow deleted / banned users to be able to log in, and delete their data.

- Fixes #3973

* Add api test.
2025-04-29 10:41:50 -04:00
Nutomic
6d297f3bea
Fixes for registration denied reason, merge translations (#5653) 2025-04-28 10:51:42 -04:00
Richard Schwab
fca1be9862
Ensure new posts in NSFW communities are marked NSFW (#5649)
Clients exposing the NSFW setting to users will typically do so by providing a
checkbox, which is either checked or unchecked, but there is no third option
to let the server decide. As a result, virtually all posts created through
user interfaces will have a bool value for NSFW, so this logic likely is used
only for posts created by scripts/bots.

In #5310 the behavior for new posts was changed to default the NSFW flag to
the community's NSFW setting, but it only did so as a default if no value was
provided when creating a post via API.

This changes the logic to force all new posts created via API or received from
federation to be NSFW if the community they're posted in is marked NSFW,
otherwise use the value provided by the creator, with a default of false if
nothing is provided.

It also ensures that this logic is used for filtering out NSFW posts on
instances blocking NSFW content.
2025-04-28 11:49:23 +02:00
Dessalines
d2d351beb8
Revert "Remove cargo-binstall from CI." (#5638)
* Revert "Remove cargo-binstall from CI. (#5625)"

This reverts commit ed5a3831aa.

* Trying to use 1.2.5

* shear 1.2.6

* Using untagged shear
2025-04-28 09:59:18 +02:00
Dessalines
db0c340f32
Upgrading captcha, other deps. (#5648) 2025-04-28 09:39:00 +02:00
Nutomic
105f9c5eed
Speedup compilation by removing modlog dependency (ref #5614) (#5640)
* Speedup compilation by removing modlog dependency (ref #5614)

* fix test

* Remove resolver line
2025-04-25 09:00:25 -04:00
matc-pub
dfe69e78a2
Fix can_mod comparison with null and admin creator check (#5628)
* Fix can_mod comparison with null and admin creator check

* Rename local user join helper

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2025-04-25 11:09:35 +02:00
Dessalines
d5e9f75fcd
List hidden posts (#5611)
* 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

* 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

* Starting to work on removing rest of page / limit.

* Issues with community pagination.

* Rename the traits and paginationcursor::new

* remove duplicate fields

* remove "aggregates" from index names

* uncomment indices

* if count = 0

* Using combined trait.

* 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)

* Removing empty files.

* 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

* Updating lemmy-js-client.

* Fixing a few cases.

* Fixing list_banned.

* Starting to convert to lemmy results.

* Fixing vote_view.

* Close to finishing up errors.

* Got compiling.

* Remove tracing for CI.

* Removing unused errors.

* Fixing merge from main.

* lower_name community_view sort.

* Syntax errors.

* Removing rest of Result from db_schema, db_views.

* Finally compiling again.

* fmt.

* Subpath tries again.

* Adding some more indexes./

* Fixing shear.

* Fix keyword_blocks test.

* @dullbananas fixes to Subpath, fixing comment tests.

* sql fmt

* Fixing unused error.

* API test fixing

* Moving read_only_posts to its own endpoint, sorted by read date.

- Fixes #5505

* Adding endpoint to list hidden posts.

- Fixes #5607

* Adding a first_id helper function.

* Fixing api_common

* Addressing PR comments

* Addressing PR comments 1.

* Using id desc.

* Addressing PR comments 2.

* Removing the reverse_timestamp keys for the post table.

* Make community_title and community_lower_name indexes desc

* Remove featured_community from post sort

* Forgot to drop index.

* Addressing PR comments

---------

Co-authored-by: Felix Ableitner <me@nutomic.com>
Co-authored-by: dullbananas <dull.bananas0@gmail.com>
2025-04-24 10:27:49 -04:00
Dessalines
baaf546a59
Add ko-fi (#5637)
* Add ko-fi

* Add to other readmes.
2025-04-24 08:45:23 -04:00
matc-pub
4b877c5119
Update mod_ban.instance_id for existing entries (#5627)
* Update mod_ban.instance_id for existing entries

* Update mod_ban.instance_id in site_person_ban migration
2025-04-24 12:15:57 +02:00
matc-pub
215dfa33df
skip_serializing_none for CommunityView, PendingFollow (#5626)
* skip_serializing_none for CommunityView, PendingFollow

* Forgot to delete file.

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: Dessalines <tyhou13@gmx.com>
2025-04-23 14:31:12 -04:00
Dessalines
88dbf58373
Move read only posts to its own endpoint. (#5610)
* 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

* 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

* Starting to work on removing rest of page / limit.

* Issues with community pagination.

* Rename the traits and paginationcursor::new

* remove duplicate fields

* remove "aggregates" from index names

* uncomment indices

* if count = 0

* Using combined trait.

* 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)

* Removing empty files.

* 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

* Updating lemmy-js-client.

* Fixing a few cases.

* Fixing list_banned.

* Starting to convert to lemmy results.

* Fixing vote_view.

* Close to finishing up errors.

* Got compiling.

* Remove tracing for CI.

* Removing unused errors.

* Fixing merge from main.

* lower_name community_view sort.

* Syntax errors.

* Removing rest of Result from db_schema, db_views.

* Finally compiling again.

* fmt.

* Subpath tries again.

* Adding some more indexes./

* Fixing shear.

* Fix keyword_blocks test.

* @dullbananas fixes to Subpath, fixing comment tests.

* sql fmt

* Fixing unused error.

* API test fixing

* Moving read_only_posts to its own endpoint, sorted by read date.

- Fixes #5505

* Adding a first_id helper function.

* Fixing api_common

* Addressing PR comments

* Addressing PR comments 1.

* Using id desc.

* Addressing PR comments 2.

* Removing the reverse_timestamp keys for the post table.

* Make community_title and community_lower_name indexes desc

* Remove featured_community from post sort

* Forgot to drop index.

* Addressing PR comments

---------

Co-authored-by: Felix Ableitner <me@nutomic.com>
Co-authored-by: dullbananas <dull.bananas0@gmail.com>
2025-04-23 13:59:10 -04:00
Dessalines
fe50d8ad67
Splitting DB_views into separate crates. (#5617)
* 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

* 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

* Starting to work on removing rest of page / limit.

* Issues with community pagination.

* Rename the traits and paginationcursor::new

* remove duplicate fields

* remove "aggregates" from index names

* uncomment indices

* if count = 0

* Using combined trait.

* 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)

* Removing empty files.

* 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

* Updating lemmy-js-client.

* Fixing a few cases.

* Fixing list_banned.

* Starting to convert to lemmy results.

* Fixing vote_view.

* Close to finishing up errors.

* Got compiling.

* Remove tracing for CI.

* Removing unused errors.

* Fixing merge from main.

* lower_name community_view sort.

* Syntax errors.

* Removing rest of Result from db_schema, db_views.

* Finally compiling again.

* fmt.

* Subpath tries again.

* Adding some more indexes./

* Fixing shear.

* Fix keyword_blocks test.

* @dullbananas fixes to Subpath, fixing comment tests.

* sql fmt

* Fixing unused error.

* API test fixing

* Adding a first_id helper function.

* Fixing api_common

* Addressing PR comments

* Views to workspace, halfway done.

* More views done.

* Finishing up views

* Running cargo shear.

* taplo fmt.

* cargo fmt

* Remove empty files

* Splitting out combined views.

* Fixing api_common diesel

* taplo

* Fixing imports for api_common

* Addressing PR comments 1.

* Using id desc.

* Addressing PR comments 2.

* Removing the reverse_timestamp keys for the post table.

* Make community_title and community_lower_name indexes desc

* Remove featured_community from post sort

* Forgot to drop index.

---------

Co-authored-by: Felix Ableitner <me@nutomic.com>
Co-authored-by: dullbananas <dull.bananas0@gmail.com>
2025-04-23 14:55:26 +02:00
Dessalines
ed5a3831aa
Remove cargo-binstall from CI. (#5625)
- There are only 2 of these left anyway, and we're getting CI
  errors using bins.
2025-04-16 13:12:21 -04:00
Dessalines
e431fce02e
Remove rest of page limit (#5429)
* 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

* 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

* Starting to work on removing rest of page / limit.

* Issues with community pagination.

* Rename the traits and paginationcursor::new

* remove duplicate fields

* remove "aggregates" from index names

* uncomment indices

* if count = 0

* Using combined trait.

* 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)

* Removing empty files.

* 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

* Updating lemmy-js-client.

* Fixing a few cases.

* Fixing list_banned.

* Starting to convert to lemmy results.

* Fixing vote_view.

* Close to finishing up errors.

* Got compiling.

* Remove tracing for CI.

* Removing unused errors.

* Fixing merge from main.

* lower_name community_view sort.

* Syntax errors.

* Removing rest of Result from db_schema, db_views.

* Finally compiling again.

* fmt.

* Subpath tries again.

* Adding some more indexes./

* Fixing shear.

* Fix keyword_blocks test.

* @dullbananas fixes to Subpath, fixing comment tests.

* sql fmt

* Fixing unused error.

* API test fixing

* Adding a first_id helper function.

* Fixing api_common

* Addressing PR comments

* Addressing PR comments 1.

* Using id desc.

* Addressing PR comments 2.

* Removing the reverse_timestamp keys for the post table.

* Make community_title and community_lower_name indexes desc

* Remove featured_community from post sort

* Forgot to drop index.

---------

Co-authored-by: Felix Ableitner <me@nutomic.com>
Co-authored-by: dullbananas <dull.bananas0@gmail.com>
2025-04-15 21:24:46 -04:00
Richard Schwab
a31a7d7eb6
Avoid sending BanFromSite activities twice on user purges (#5615)
Prior to #5515, when a user was purged, a function was called to ensure that
in addtition to the site ban, purges of remote users would result in
individual community bans for each local local community being federated out,
as this was an intermediate solution to address the lack of federated content
removal otherwise.

As proper handling of banned users was implemented in that PR, the logic for
federating out community bans was changed to federate directly as a site ban.
This logic already existed in the user purge function, resulting in
duplication.

The first instance of the ban is kept rather than the second one to ensure
that federation happens even if any of the later local DB writes run into
issues, as those will be more likely to be caught by the admin performing the
purge, so they can just repeat the request to resolve that.
2025-04-11 08:46:21 -04:00
Nutomic
80a5406c7e
Add instance setting to disable email notifications (fixes #3011) (#5603)
* Add instance setting to disable email notifications (fixes #3011)

* Dont read site_view again. (#5606)

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2025-04-09 10:04:41 -04:00
Nutomic
1f04aceb94
Provide native binary for releases (#5583)
* remove code for fast compile

* publish native binary

* publish

* pwd

* permission

* cleanup

* gzip

* sha256sum

* Revert "remove code for fast compile"

This reverts commit fc7a1edba8.

* comments

* add default

* fmt

* mark as prerelease
2025-04-08 08:47:03 -04:00
leoseg
f027eca661
Feature filter keywords 3710 (#5263)
* created new table post_keyword_block related to a person and corresponding functions in diesel

* created corresponding api functions

* converted like to ilike in filter

* Fixxed errors for adding keywords for blocking posts

* Fixxed errors in diesel migrations

* Removed debug print

* #3710: Fixxed errors caused by cargo check

* #3710: added up and down scripts for diesel

* added tmp.schema to gitignore

* updated tests

* fixxed test

* fixxed error from rebasing

* Added max number of block tags and modified max length of block tags

* formatted code

* added migration to restrict block keyword length

* #3710: Added check if Blocked keyword is already existing

* #3710: Removed deprecated any

* #3710: Updated keyword length

* #3710: Fixxed errors from master merge

* #3710: Formatting

* #3710: Removed api to block keywords for post from v3 and changed of api path in v4

* #3710: Renamed post_keyword_block table to user_post_keyword_block and replaced id as primary key with the composed key person_id and keyword. Also now use update function which updates the blocked keywords for an user with a new list instead keyword by keyword.

* #3710: Formatted code

* #3710: Removed unnecessary parts for the block API in post as this will be done over the user settings

* #3710: Modified data structure for blocking keywords to reference local user and added update function which will update at all keywords for a local user at once

* #3710: Modified code so updating blocked keywords is now done over user settings

* #3710: Fixxed merging error

* #3710: Fixxed filter query

* #3710: Formatted Code

* #3710: Added suggested changes from review: keyword block update now does delete and then insert, postview uses read from LocalKeywordBlock, and validation with min_length_check and max_length_check

* #3710: formatted code

* c

* #3710: removed BlockKeywordForPost struct

* #3710: formatted code

* #3710: formatted code

* #3710: formatted code
2025-04-08 09:39:52 +02:00
Dessalines
2f7ce1cb63
Adding admin image deletion endpoint. (#5588)
* Adding admin image deletion endpoint.

- Also moving the list media endpoints, since these can go under a
  common heading.
- Fixes #5563

* Changing list_all to list

* Fixing api tests.

* Delete all aliases.

* Fixing comment.

* Updating lemmy-js-client.
2025-04-07 17:17:29 -04:00
Nutomic
d4e76a11d9
Fix random failures in can_mod test (#5594) 2025-04-07 15:06:15 -04:00
Nutomic
a931a4b289
Increase registration rate limit to 10 per hour (ref #5548) (#5600) 2025-04-07 14:31:20 -04:00
phiresky
74701af627
Community post tags (part 2: API methods) (#5389)
* post tags part 2

* post tags part 2 (api methods)

* re-remove tracing

* api tests

* update according to comments

* update lints and api package

* validate tags, fix compile

* insert many simultaneously

* o

* temp revert for tests

* update dep

* Revert "temp revert for tests"

This reverts commit 62f17de60d.

* fix deps

* limit tag length

* fix comments

* rename display_name

* lint

* lint

* bullshit

* clarify comment

* fix after merge

* lint.sh

* upgrade dep

* rename

* dep

---------

Co-authored-by: Dessalines <tyhou13@gmx.com>
2025-04-04 14:26:25 -04:00
Richard Schwab
9bfaad8a0d
Move community API database writes into transactions (#5595) 2025-04-04 09:33:38 -04:00