Commit Graph

268 Commits (main)

Author SHA1 Message Date
Nutomic 723cb549d4
Allow importing partial backup (fixes #4672) (#4705)
* Allow importing partial backup (fixes #4672)

* Dont throw error on empty LocalUser::update

* fix tests
5 days ago
Dessalines 2fecb7ecdf
Dont show own comments for liked and disliked_only. Fixes #4675 (#4679)
Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
3 weeks ago
Dessalines 5c35e97a75
Dont show deleted / removed posts when searching. Fixes #4576 (#4671)
* Dont show deleted / removed posts when searching. Fixes #4576

* Address PR comments.

* Clean up comment removed also.

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
3 weeks ago
tracyspacy 0eaf8d33e7
Filter_removed_comments_from_search (#4634)
* filter_removed_comments_from_search

* Revert "filter_removed_comments_from_search"

This reverts commit c6d6490afa.

* filtering_removed_comments_search

* filter_deleted_comments

* Revert "filter_deleted_comments"

This reverts commit 7dc1d13d24.

* Revert "filtering_removed_comments_search"

This reverts commit 6e9b1de7a2.

* filtering_removed_dELeted_comments_search
4 weeks ago
TechVest b0370ae2fd
chore: fix some comments (#4637)
Signed-off-by: TechVest <techdashen@qq.com>
1 month ago
Dessalines 6efab9aab1
Creating a LocalImageView, so that front ends have the Person struct. (#4631)
* Creating a LocalImageView, so that front ends have the Person struct.

* Removing local_user from LocalImageView.

* Add uploader check.
1 month ago
Dessalines d075acce43
Make all single-fetch database calls return an Option. (#4617)
- Diesel ordinarily throws an error when no results are returned for a
  single fetch, which is a bit confusing. This PR ensures that the
  missing value cases are all caught, and wrapped with new LemmyErrors,
  rather than diesel errors.
- Fixes #4601
1 month ago
Dessalines 4d9c16a336
Fix private message sort order. #4581 (#4587) 2 months ago
Dessalines 945064726f
Add creator_banned_from_community to vote_view. (#4568)
* Add creator_banned_from_community to vote_view.

- Fixes #4561

* Adding tests.
2 months ago
Dessalines 95069d7648
Fixing some clippy and woodpecker lints. (#4565)
* Fixing some clippy and woodpecker lints.

* Try fixing woodpecker 1.

* Revert "Try fixing woodpecker 1."

This reverts commit 7c2020a08d.
2 months ago
Dessalines e4356a7701
Fixing a few broken tests from the change in LocalUser::create (#4569) 2 months ago
Nutomic 846848c4f6
On registration, automatically set content languages from `accept-language` header (#4550)
* On registration, automatically set content languages from accept header

* no need to set site language or default language for new user anymore

* fix test

* fix langs

* avoid duplicate writing of new user languages
2 months ago
SleeplessOne1917 38c22d9453
Add banned_from_community to PostView and CommentView (#4552)
* Add banned_from_community to PostView and CommentView

* Add post view test

* Add tests for CommentView

* Add tests for case where local user is not banned from community

---------

Co-authored-by: SleeplessOne1917 <insomnia-void@protonmail.com>
2 months ago
Dessalines 255e695633
Adding extra fields to PostReport and CommentReport views. (#4520)
- Fixes #4200
2 months ago
Dessalines 15f02f00a9
Add a vote_display_mode local_user setting. (#4450)
* Add a vote_display_mode local_user setting.

- Fixes #4449

* Changing HideDownvotes to Score.

* Adding ScoreAndDownvote display mode.

* Adding upvote and downvote mode.

* Extracting vote_display_mode to another table.

* Fixing fmt.

* Remove published and updated columns.

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2 months ago
Nutomic 5859502a2a
Fix missing private key for signed fetch (#4516)
* Fix missing private key for signed fetch (fixes #4451)

* clippy

* instance actor name and webfinger

* better webfinger handling

* upgrade lib

* update test asset
2 months ago
Nutomic 157378b4c9
Clear text of deleted/removed comments (#4503) 3 months ago
Dessalines 7f9950fe85
Add alt_text for posts. Fixes #1086 (#4477)
* Add alt_text for posts. Fixes #1086

* Moving alt_text to attachment name.

* Cleaning up mod action line.

* Addressing PR comments

* Addressing PR comments.

* Fixing clones.
3 months ago
Dessalines 52155c74cb
View report history for a post or comment. Fixes #4190 (#4492) 3 months ago
Dessalines eb1245bceb
When using `saved_only`, sort posts / comments by the saved publish time, not the item creation time (#4479)
* Work on saved selection.

* Using single value for join.

* Removing unecessary check.

* Remove saved_only pointless block.
3 months ago
Dessalines 87b577467b
Adding ability to hide posts. (#4480)
* Adding ability to hide posts.

- Adds an post/hide API route.
- Adds a `show_hidden` (default false) to `GetPosts`.
- Adds a `hidden` field to `PostView`.
- Removes the single `post_id` from MarkPostAsRead.
- Fixes #1403

* Add a check to make sure hidden field is true.

* Fixing test.

* Add back semicolon
3 months ago
Nutomic 328a48c9f5
Remove error-type feature from lemmy-utils (#4474)
* Remove error-type feature from lemmy-utils

* fixes

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
3 months ago
SleeplessOne1917 f42420809b
Expose LemmyErrorType in lemmy_api_common (#4439)
* Expose LemmyErrorType in lemmy_api_common

* Make conditional compilation gates for utils

* Make it so api_common doesn't pull in unnecessary deps

* Make error type non exhaustive

* Fix formatting

* Format toml

* Add some convenience derives to LemmyError

* Simplify features

* Fix CI compile error

---------

Co-authored-by: SleeplessOne1917 <insomnia-void@protonmail.com>
3 months ago
dullbananas ae62ef2b7e
Ignore expired bans in CommentReportView::read, just like in CommentReportQuery::list (#4457)
* Update comment_report_view.rs

* Update comment_report_view.rs

* Update comment_report_view.rs

* Update comment_report_view.rs
3 months ago
Nutomic 86b44c2a4d
Add site.content_warning, local_site.default_post_listing_mode (#4393)
* Include local_site.content_warning setting for showing nsfw by default

* Add community setting `only_followers_can_vote`

* clippy

* add auto_expand_images site setting

* cleanup

* add missing api params

* postquery/communityquery changes

* clippy

* change error

* replace auto_expand_images with default_site_post_listing_mode

* change post/community query params

* get rid of only_followers_can_vote

* machete

* fix

* clippy

* revert remaining vote changes

* remove dead code

* remove unused var

* fmt
3 months ago
Dessalines a3bf2f1cf1
Auto resolve reports on removing a comment or post. Fixes #4390 (#4402)
* Automatically resolve report when post/comment is removed (#3850)

* Automatically resolve report when post/comment is removed

* also handle apub removes

* Removing auto-resolve report triggers.

* Dont allow creating reports for deleted / removed items.

* Running pgformat.

* Fixing test.

* Addressing PR comments.

* Forgot comment report.

---------

Co-authored-by: Nutomic <me@nutomic.com>
3 months ago
Dessalines 33989f5518
Blocking an instance also hides private messages from their users. (#4447)
* Blocking an instance also hides private messages from their users.

- Fixes #4444

* Separating private message tests.
3 months ago
SleeplessOne1917 300869d397
Make request models derive PartialEq, Eq, and Hash (#4443)
* Make request models derive PartialEq, Eq, and Hash

* Fix clippy error

---------

Co-authored-by: SleeplessOne1917 <insomnia-void@protonmail.com>
3 months ago
Nutomic 0f414a95d5
Local only community (#4350)
* Add support for local only community (fixes #1576)

* add filters and tests to db views

* dont federate local only community

* test get apub community http

* tests

* more checks

* wip

* api test

* fix tests

* change community.local_only column to visibility enum
(for private communities)

* sql fmt

* rename vars

* clippy

* fix tests

* update lib

* review

* fix js client version

* update client
4 months ago
Nutomic e8a52d3a5c
Rewrite images to use local proxy (#4035)
* Add markdown rule to add rel=nofollow for all links

* Add markdown image rule to add local image proxy (fixes #1036)

* comments

* rewrite markdown image links working

* add comment

* perform markdown image processing in api/apub receivers

* clippy

* add db table to validate proxied links

* rewrite link fields for avatar, banner etc

* sql fmt

* proxy links received over federation

* add config option

* undo post.url rewriting, move http route definition

* add tests

* proxy images through pictrs

* testing

* cleanup request.rs file

* more cleanup (fixes #2611)

* include url content type when sending post over apub (fixes #2611)

* store post url content type in db

* should be media_type

* get rid of cache_remote_thumbnails setting, instead automatically
take thumbnail from federation data if available.

* fix tests

* add setting disable_external_link_previews

* federate post url as image depending on mime type

* change setting again

* machete

* invert

* support custom emoji

* clippy

* update defaults

* add image proxy test, fix test

* fix test

* clippy

* revert accidental changes

* address review

* clippy

* Markdown link rule-dess (#4356)

* Extracting opengraph_data to its own type.

* A few additions for markdown-link-rule.

---------

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

* fix setting

* use enum for image proxy setting

* fix test configs

* add config backwards compat

* clippy

* machete

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
4 months ago
dullbananas d8f9e8a64c
Post view: move cursor pagination to separate library, add backward pagination to PostQuery (#4320)
* stuff

* stuff

* crates.io

* Update up.sql

* Rerun federation tests

* Update post_view.rs

* Update post_view.rs

* Update up.sql

* Update utils.rs

* Fix precision loss

* Update up.sql

* Update down.sql

* remove unwrap

* Update post_view.rs

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
4 months ago
dullbananas 759f6d8a9a
Better query plan viewing experience (#4285)
* stuff

* stuff including batch_upsert function

* stuff

* do things

* stuff

* different timestamps

* stuff

* Revert changes to comment.rs

* Update comment.rs

* Update comment.rs

* Update post_view.rs

* Update utils.rs

* Update up.sql

* Update up.sql

* Update down.sql

* Update up.sql

* Update main.rs

* use anyhow macro

* replace get(0) with first()

* as_slice

* Update series.rs

* Update db_perf.sh

* Update and rename crates/db_schema/src/utils/series.rs to crates/db_perf/src/series.rs

* Update utils.rs

* Update main.rs

* Update main.rs

* Update .woodpecker.yml

* fmt main.rs

* Update .woodpecker.yml

* Instance::delete at end

* Update main.rs

* Update Cargo.toml

---------

Co-authored-by: Nutomic <me@nutomic.com>
4 months ago
jim-taylor-business f43d2eca70
make inner type pub so it can be read and created easily in other crates (#4397)
this is for use in SSR pagination in Lemmy-UI-Leptos
4 months ago
Nutomic 0868910570
Add secondary sort by published date for post view (fixes #4383) (#4384) 4 months ago
dullbananas 1ef90773e0
Refactor post view tests (#4313)
* Refactor post view tests

* Update post_view.rs

* Update post_view.rs

* Update post_view.rs

* Update post_view.rs

* Update post_view.rs

* Update post_view.rs

* Update post_view.rs

* remove unused import
4 months ago
Nutomic 38e64825e6
Add macro assert_length!() for tests (#4348)
* Add macro assert_length!() for tests

* fix

* number
5 months ago
ALEX11BR a5289dd4cf
Use `pretty_assertions` for assertions (#4347)
* Use `pretty_assertions` for assertions

* fixed ordering of `use`s

* ci

---------

Co-authored-by: Felix Ableitner <me@nutomic.com>
5 months ago
Dessalines 009a45dffb
Adding /post/like/list and /comment/like/list for admins. (#4332)
- Allows admins to view likes, sorted by downvotes first,
  for a given comment or post.
- Fixes #4088
5 months ago
Nutomic a507a39336
Add missing test cleanup (#4289)
* Add missing test cleanup

* cleanup
5 months ago
Dessalines 2899ba0131
Fixing broken post_read logic. Fixes #4290 (#4297) 5 months ago
dullbananas a7ba5c9dd3
Sort by post id in post view (#4270)
* Sort by post id in post view

* Remove tie_breaker

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: Nutomic <me@nutomic.com>
5 months ago
Dessalines 246e38a45b
Making login case-insensitive. Fixes #4272 (#4273)
* Making login case-insensitive. Fixes #4272

* Removing redundant lowercase.
5 months ago
dullbananas 32afc32bc0
Correctly combine sorts in post view cursor-based pagination (#4247)
* Update post_view.rs

* Update post_view.rs

* Update Cargo.toml

* Update post_view.rs

* fix

* Update post_view.rs

---------

Co-authored-by: SleeplessOne1917 <abias1122@gmail.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
5 months ago
dullbananas 5e589004a5
Add test for fixed deleted post filter (#4256)
* Add test for fixed deleted post filter

* fmt

* Fmt

* Update post_view.rs
5 months ago
dullbananas a0ef56b9b7
Remove moderator_view field from PostQuery (#4255) 5 months ago
Dessalines f764996745
Show federated posts on user profile. Fixes #4228 (#4229)
* Show federated posts on user profile. Fixes #4228

* Make sure posts are hidden if no listing_type is given.
5 months ago
Dessalines 86990d5138
Registrations and Reports should sort by New when viewing unresolved / unread. (#4207)
- Fixes #4206
6 months ago
Dessalines 6e4278b1c9
Setting rank column defaults to a small number. Fixes #4178 (#4191)
* Setting rank column defaults to a small number. Fixes #4178

* Fixing tests.
6 months ago
Nutomic 26297b4035
Users can view their own posts after removal (fixes #4186) (#4192) 6 months ago
Nutomic e58a167d64
Fix remote community posts appearing in local listing (fixes #4180) (#4181)
* Fix remote community posts appearing in local listing (fixes #4180)

* fmt

* fix typo
6 months ago