Commit Graph

4273 Commits (384e55f0e4ecfb000f66a60e9e2ddb52645b983e)
 

Author SHA1 Message Date
biosfood 384e55f0e4
update moderator view (#3820)
* update api tests for new moderator view

* chage moderator view to be a listing type in get posts

Note: Internally, the listing type is called ListingType.ModeratorView,
but it's called "Moderator View" in the api endpoint

* fix formatting

* add support for moderator view to list comments

* add api test for moderator view when listing comments

* fix api test formatting

* retry tests

* don't filter out blocked users and communities when using moderator view

* fix cargo tests failing

* fix formatting

* fix previous merge

* Adding ModeratorView to listing_type_enums

* Fixing fmt.

* Adding a default to ListingType.

* Upgrading to use new lemmy-js-client.

---------

Co-authored-by: Nutomic <me@nutomic.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: Dessalines <tyhou13@gmx.com>
9 months ago
Lukas Trombach c93bde9799
replace `expect` with `ErrorUnauthorized` (#3915)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
9 months ago
Nutomic b2aee565f3
Allow passing auth via header or cookie (#3725)
* Allow passing auth via header or cookie

* revert submodule

* taplo

* fix build

* working

* convert apub api methods

* also set cache-control header

* opt

* clippy

* deduplicate code, ignore invalid auth

* clippy

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
9 months ago
Nutomic 7fd14b3d2a
Make remove content optional during account deletion (fixes #1617) (#3817)
* Make remove content optional during account deletion (fixes #1617)

* simplify purge params by passing context

* update js client

* add delete content

* update woodpecker config

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
9 months ago
Lukas Trombach 26d125cc63
Sitemap - use UTC time (#3914)
* change local filter to use `eq` function

* use Utc time for sitemap
9 months ago
phiresky 514f2222e0
Fix time zone handling (#3496)
* convert naive time to utc time

* compounding fixes

* cargo fmt

* fix the rest

* fix down migration

* fix migrations

* fix after merge

* clippy fix

* ap-fed 0.5.0

---------

Co-authored-by: Nutomic <me@nutomic.com>
9 months ago
Nutomic 6047257bfc
Move admin flag from person to local_user (fixes #3060) (#3403)
* Move admin flag from person to local_user (fixes #3060)

The person table is for federated data, but admin flag can only
apply to local users. Thats why it really belongs in the local_user
table. This will also prevent the federation code from accidentally
overwriting the admin flag

* fmt

* try to fix api tests

* lint

* fix person view

* ci

* ci

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
9 months ago
Freakazoid182 51ccf318e8
Lowercase domain on db query filters (#3849) (#3873)
* Lowercase domain on db query filters (#3849)

* Add test to get a community on different cased domain (#3849)

* Lowercase the identity for webfinger (#3849)

* Lowercase both sides of the domain comparison (#3849)

* Format api_tests (#3849)

* Lowercase domain lookup on Instance and Person (#3849)

---------

Co-authored-by: Freek van Zee <freek.van.zee@mediamonks.com>
Co-authored-by: Freakazoid182 <>
9 months ago
Lukas Trombach 28324ad2c8
Sitemap (#3808)
* generate sitemap.xml file

* set up endpoint for sitemap

* Update sitemap generation

- remove sitemap generation from scheduled tasks
- add posts query for sitemap
- create sitemap module in API crate

* remove priority and change freq from sitemap

* add configuration option for number of posts for sitemap

* fix default config

* rate limit sitemap endpoint

* update sitemap query

* update sitemap generation

- remove config value for query limit
- adjust sitemap generation to query changes
- tidy up error handling

* refactor sitemap generation loop

* remove `limit` argument

* refactor `generate_urlset` and add unit test

* change query to only fetch local posts of past 24h

* fix outdated comment and log

* cargo fmt
9 months ago
Alex Roman ab828b81e4
fix: add client connect timeout to scheduled task (#3883) 10 months ago
Freakazoid182 ee7b35a04a
Add person name to PersonIsBannedFromSite error (#3786) (#3855)
* Add person name to PersonIsBannedFromSite error (#3786)

* Log PersonId instead of Person name (#3850)

* Log actor_id for PersonIsBannedFromSite (#3850)

---------

Co-authored-by: Freek van Zee <freek.van.zee@mediamonks.com>
10 months ago
Freakazoid182 c8063f3267
Replace Option<bool> with bool for PostQuery and CommentQuery (#3819) (#3857)
* Replace Option<bool> with bool for PostQuery and CommentQuery (#3819)

* Replace Option<bool> from all list queries (#3819)

---------

Co-authored-by: Freek van Zee <freek.van.zee@mediamonks.com>
10 months ago
Maarten Vercruysse 9b710a2ed3
Update .woodpecker.yml use steps instead (#3858) 10 months ago
Dessalines 654bc513ea
Fixing woodpecker env var. (#3854) 10 months ago
Dessalines 29869b132c
Adding 0.18.4 Release notes. (#3853) 10 months ago
Nutomic f7f6766650
Automatically resolve report when post/comment is removed (#3850)
* Automatically resolve report when post/comment is removed

* also handle apub removes
10 months ago
Nutomic ae438e148e
Speedup CI (#3852)
* Speedup CI

* run tests in parallel

* restore cp

* main push

* no self update

* parallel format
10 months ago
Nutomic 33b2d67be6
Reorder woodpecker config to avoid ci failures (#3851) 10 months ago
dullbananas 969f8b2ce9
Replace TypedBuilder with Default in update forms (#3814)
* Update comment.rs

* Update community.rs

* Update local_site.rs

* Update local_site_rate_limit.rs

* Update local_user.rs

* Update person.rs

* Update comment.rs

* Update community.rs

* Update local_site.rs

* Update local_site_rate_limit.rs

* Update local_user.rs

* Update post.rs

* Update private_message.rs

* Update site.rs

* Update post.rs

* Update person.rs

* Update private_message.rs

* Update comment.rs

* Update create.rs

* Update leave_admin.rs

* Update update.rs

* Update remove.rs

* Update add_admin.rs

* Update verify_email.rs

* Update mod.rs

* Update mod.rs

* Update undo_delete.rs

* Update undo_delete.rs

* Update utils.rs

* Update feature.rs

* Update delete.rs

* Update lock.rs

* Update create.rs

* Update approve.rs

* Update update.rs

* Update lock_page.rs

* Update block_user.rs

* Update delete.rs

* Update undo_block_user.rs

* Update collection_remove.rs

* Update post.rs

* Update hide.rs

* Update person.rs

* Update remove.rs

* Update post_view.rs

* Update create.rs

* Update remove.rs

* Update collection_add.rs

* Update community.rs

* Update update.rs

* Update post_aggregates.rs

* Update update.rs

* Update comment.rs

* Update code_migrations.rs

* Update registration_application_view.rs

* Update update.rs

* Update ban_person.rs

* Update community.rs

* Update delete.rs

* Update delete.rs

* Update delete.rs

* Update person_aggregates.rs

* Update save_settings.rs

* Update distinguish.rs

* Update mark_read.rs

* Update site_aggregates.rs

* Update create.rs

* Fix

* rerun ci

* Update comment.rs

* rerun ci

* Update create.rs

* Update create.rs

* Update post_view.rs

* rerun ci

* Update undo_delete.rs

* rerun ci
10 months ago
dullbananas a47b12bbde
Reduce amount of columns selected (#3755)
* PostAggregatesNotInPost

* CommentAggregatesNotInComment

* CommunityPersonBanAdditionalInfo (partial)

* Revert "CommunityPersonBanAdditionalInfo (partial)"

This reverts commit 158f7f0cd9.

* Replace some nullable parts of selection with id::nullable().is_not_null()

* CommunityFollower::select_subscribed_type

* WithoutId

* Add WithoutId derives

* Update Cargo.toml

* rerun ci

* Fix syntatx errors

* rerun ci

* Add missing "|" in private_message_report_view.rs

* rerun ci

* cargo fmt

* rerun ci

* Only derive WithoutId for Community with "full" feature

* rerun ci

* Fix attribute filtering in WithoutId macro

* rerun ci

* Update without_id.rs

* rerun ci

* Update without_id.rs

* rerun ci

* Fix errors

* rerun ci

* cargo fmt

* Fix errors

* rerun ci

* Move WithoutId to lib.rs

* rerun ci

* Remove macro_use for paste

* rerun ci

* Update comment_reply_view.rs

* rerun ci

* Update registration_application_view.rs

* rerun ci

* Revert "Update registration_application_view.rs"

This reverts commit 2e98e4bb83.

* Revert "Update comment_reply_view.rs"

This reverts commit 857bf9f5a2.

* Revert "Remove macro_use for paste"

This reverts commit 13247279ed.

* Revert "Move WithoutId to lib.rs"

This reverts commit 0c23e5213b.

* Revert "Fix errors"

This reverts commit a283d155e5.

* Revert "cargo fmt"

This reverts commit 36a5210352.

* Revert "Fix errors"

This reverts commit c9102c14f4.

* Revert "Update without_id.rs"

This reverts commit 19adb2fcc8.

* Revert "Update without_id.rs"

This reverts commit e26107a2fe.

* Revert "Fix attribute filtering in WithoutId macro"

This reverts commit acaa4902b0.

* Revert "Only derive WithoutId for Community with "full" feature"

This reverts commit de0e9c6fdc.

* Revert "cargo fmt"

This reverts commit 5e1bd1ce58.

* Revert "Add missing "|" in private_message_report_view.rs"

This reverts commit c7ae9f1cd5.

* Revert "Fix syntatx errors"

This reverts commit d942f099de.

* Revert "Update Cargo.toml"

This reverts commit 23cdb6f6d3.

* Revert "Add WithoutId derives"

This reverts commit 06006d6ad3.

* Revert "WithoutId"

This reverts commit 5e86922b0f.

* Revert "CommentAggregatesNotInComment"

This reverts commit 603aede7ce.

* Revert "PostAggregatesNotInPost"

This reverts commit 1ee3fcaeab.

* Restore original position of options.saved_only filter

* rerun ci

* Update post_view.rs

* rerun ci
10 months ago
Piotr Juszczyk 2ad3450004
Allow filtering posts and comments by whether they were liked/disliked - fixes #3401 (#3523)
* Allow filtering posts and comments by whether they were liked/disliked

* Switch to 2 args - liked_only, disliked_only - taking bools

* Make liked_only and disliked_only Option<bool>

* Fix unrelated is_profile_view compilation error
10 months ago
Alex Lavallee f9c2ba1cfa
Allow filtering PMs by sender (#3770)
* Allow filtering PMs by sender

* Fix retreiving own messages when filtering pm creator id

* Add tests

* Undo rename

* Fix PM tests

* Fix formatting for PMs

* Fix PM test formatting

* Rename PM creator_id field

* Fix PM formatting
10 months ago
Felix Ableitner 91c024fd98 Revert "Version 0.18.4-rc.2"
This reverts commit 48466b6826.
10 months ago
Felix Ableitner 48466b6826 Version 0.18.4-rc.2 10 months ago
maxime.io d81fb987aa
Fix sanitize_html whitespaces (#3829) 10 months ago
Felix Ableitner bed9474cf0 Revert "Attempt to fix CI building wrong commits (#3830)"
This reverts commit 5e9930bdcc.
10 months ago
dullbananas 5e9930bdcc
Attempt to fix CI building wrong commits (#3830)
* Attempt to fix CI building wrong commits

* Update .woodpecker.yml

* Update .woodpecker.yml
10 months ago
Dessalines 57cb5637fc
Fix ordering when doing a comment_parent type `list_comments` (#3823)
* Fix ordering when doing a comment_parent type GetPost.

* Fix missing options.
10 months ago
Nutomic 66ac8100d9
Remove unused db view options (#3787)
* Remove unused db view options

* fix tests

* ci
10 months ago
Nutomic 2bb24c2859
Remove form_id params (#3812) 10 months ago
Maarten Vercruysse da031a4ce2
Update QUESTION.yml, remove UI (#3807) 10 months ago
Dessalines 70fae9d68d
Fixing broken SQL migration formatting. (#3800)
* Fixing SQL format.

* Fixing clippy lints.

* Fixing clippy lint 2.
10 months ago
Nutomic 2d0f77af59
Dont use sha hash for password reset token (fixes #3491) (#3795) 10 months ago
Nutomic 27be1efb74
Rewrite remaining federation actions, get rid of PerformCrud trait (#3794)
* Rewrite ban actions

* Rewrite delete/remove actions

* Rewrite remove/delete community

* Rewrite report actions

* Rewrite feature/lock post

* Rewrite update community actions

* Rewrite remaining federation actions

* Get rid of PerformCrud trait

* clippy
10 months ago
Dessalines be1389420b
Adding SQL format checking via `pg_format` / pgFormatter (#3740)
* SQL format checking, 1.

* SQL format checking, 2.

* SQL format checking, 3.

* SQL format checking, 4.

* SQL format checking, 5.

* Running pg_format

* Getting rid of comment.

* Upping pg_format version.

* Using git ls-files for sql format check.

* Fixing sql lints.

* Addressing PR comments.
10 months ago
RocketDerp b4380cb548
Do not hide read posts when it is a user profile view (#3791) 10 months ago
Nutomic 58388f2ce8
Only run slow CI checks for actual code changes (attempt 2) (#3759)
* Only run slow CI checks for actual code changes (attempt 2)

* use when path include

* change rust

* update

* x

* y

* zsad

* remove println

* fmt

* readme

* Revert "readme"

This reverts commit d58b6ad973.

* ci

* gitmodules
10 months ago
Louis GERARD 7bc64ab91a
Remove follow community traits (#3737)
* chore(FollowCommunity): remove Perform and Send Activity traits

* chore(FollowCommunity): avoid fetching community and person from db
10 months ago
dullbananas 91834d0d21
Default imprementations for read and delete in Crud trait (#3707)
* h

* Start doing stuff

* Default impl for Crud::read

* Simplify Crud::read lifetimes

* fmt

* Stuff

* Stuff

* Successfully make default read implementation work

* Restore Person::read

* Clean up default Crud::read and rename 'query2

* Replace filter with find

* Attempt default Crud::create

* Change Crud to Crud<'a> (won't compile)

* Revert "Change Crud to Crud<'a> (won't compile)"

This reverts commit 7ed20f5f71.

* Default Crud::delete

* Remove Crud::delete definitions that match default

* Remove commented Site::read

* Insert trait

* Revert "Insert trait"

This reverts commit 9d780c2403.

* Use non-borrowed forms

* Revert "Use non-borrowed forms"

This reverts commit d2dd442563.

* Revert "Revert "Change Crud to Crud<'a> (won't compile)""

This reverts commit 25a27165a8.

* Fix lifetime for everything except Crud::delete

* Fix Crud::delete

* Add comment about futures

* Attempt Crud::create

* Attempt separate CrudBounds

* Revert "Attempt separate CrudBounds"

This reverts commit 1b4ca321c3.

* Try to fix Crud::create

* Move lifetime parameters to associated types

* Revert "Move lifetime parameters to associated types"

This reverts commit af1bc858ce.

* Revert "Try to fix Crud::create"

This reverts commit eec238496c.

* Revert "Revert "Attempt separate CrudBounds""

This reverts commit 1ec33ce502.

* Revert "Attempt separate CrudBounds"

This reverts commit 1b4ca321c3.

* Revert "Attempt Crud::create"

This reverts commit 47e8071b68.

* Revert "Add comment about futures"

This reverts commit b266b14653.

* Revert "Fix Crud::delete"

This reverts commit 3abcce2eec.

* Revert "Fix lifetime for everything except Crud::delete"

This reverts commit c1ad7a161b.

* Revert "Revert "Revert "Change Crud to Crud<'a> (won't compile)"""

This reverts commit 3129cd0fc3.

* Clean up

* Update site.rs
10 months ago
Nutomic d82194cfe9
Rewrite some federation actions to remove Perform/SendActivity (ref #3670) (#3758) 10 months ago
RocketDerp 05a7fced65
Enhanced testing of comments. Validate reply notifications, mentions (#3686)
* shared.ts first test of getReplies

* comment testing now validates reply notifications and mentions, some code comment cleanup in other functions

* comments revised

* first use of getUnreadCount in testing

* test notification of new comment replies, clarify usage of getReplies

* killall moved earlier in bash script

* api-test jest run does not need directory prefix, make consistent with other jest runs

* do not put my testing system password into script

* fix, killall exits script when no process found

* killall now moved to parent script to release locks before database create

* need to run killall a second time, before database drop

* first use of getReplies getPosts saveUserSettings

* accidental duplication of functions, removed

* try to sync shared library with main

* Nutomic feedback: Better to rename the var instead of putting a comment which can easily get outdated.

* Correct logic to meet join-lemmy requirement, don't have closed signups. Allows Open and Applications. (#3761)

Co-authored-by: Josh Bernardini <josh.bernardini@cologix.com>

* Fix fetch instance software version from nodeinfo (#3772)

Fixes #3771

* remove unused code, revert killall change

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: figure-0e <133478007+figure-0e@users.noreply.github.com>
Co-authored-by: Josh Bernardini <josh.bernardini@cologix.com>
Co-authored-by: Denis Dzyubenko <denis@ddenis.info>
Co-authored-by: Felix Ableitner <me@nutomic.com>
10 months ago
Denis Dzyubenko 55e383ae38
Fix fetch instance software version from nodeinfo (#3772)
Fixes #3771
10 months ago
figure-0e 6ed2ddf76d
Correct logic to meet join-lemmy requirement, don't have closed signups. Allows Open and Applications. (#3761)
Co-authored-by: Josh Bernardini <josh.bernardini@cologix.com>
10 months ago
Felix Ableitner 963d04b352 Revert "Only run slow CI checks for actual code changes (#3750)"
This reverts commit a34e0d477e.
10 months ago
Nutomic 543bd99900
Update CODEOWNERS (#3748) 10 months ago
Nutomic 39752fa096
Delete migrations_testing folder (#3751)
Its completely unused as far as I can see
10 months ago
Nutomic e365d48769
Move entry from .rgignore to .gitignore (#3752)
rg command respects gitignore, and sql dumps should be ignored by
git as well. So theres no reason to have a separate file.
10 months ago
Nutomic 37998b3398
Rewrite some API handlers to remove Perform trait (#3735)
* Rewrite some API handlers to remove Perform trait

* Convert CreateComment

* ci
10 months ago
Dessalines db76c5b7ff
Adding 0.18.3 Release notes. (#3753) 10 months ago
Nutomic a34e0d477e
Only run slow CI checks for actual code changes (#3750)
* Only run slow CI checks for actual code changes

Its a waste of time to compile Rust and run tests when only
something like the readme was changed.

* also make cache restore/rebuild conditional

* remove unused condition
10 months ago