* add private visibility
* filter private communities in post_view.rs
* also filter in comment_view
* community follower state
* remove unused method
* sql fmt
* add CommunityFollower.approved_by
* implement api endpoints
* api changes
* only admins can create private community for now
* add local api tests
* fix api tests
* follow remote private community
* use authorized fetch for content in private community
* federate community visibility
* dont mark content in private community as public
* expose ApprovalRequired in api
* also check content fetchable for outbox/featured
* address private community content to followers
* implement reject activity
* fix tests
* add files
* remove local api tests
* dont use delay
* is_new_instance
* single query for is_new_instance
* return subscribed type for pending follow
* working
* need to catch errors in waitUntil
* clippy
* fix query
* lint for unused async
* diesel.toml comment
* add comment
* avoid db reads
* rename approved_by to approver_id
* add helper
* form init
* list pending follows should return items for all communities
* clippy
* ci
* fix down migration
* fix api tests
* references
* rename
* run git diff
* ci
* fix schema check
* fix joins
* ci
* ci
* skip_serializing_none
* fix test
---------
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
* Add LemmyResult to session_middleware tests
* Add LemmyResult to inboxes tests
* Add LemmyResult to slurs tests
* Add LemmyResult to markdown tests
* Add LemmyResult to rate_limiter tests
* Add LemmyResult to error tests
* Add LemmyResult to api_common utils tests
* Add LemmyResult to request tests
* Add LemmyResult to claims tests
* Propagate registration_applications errors
* Remove clippy::unwrap_used from community tests
* Add LemmyResult to community_view tests
* Add LemmyResult to db_schema post tests
* Add LemmyResult to site_aggregates tests
* Add LemmyResult to private_message tests
* Add LemmyResult to activity tests
* Add LemmyResult to federation_allowlist tests
* Add LemmyResult to comment_aggregates tests
* Add LemmyResult to post_report tests
* Add LemmyResult to moderator tests
* Add LemmyResult to community_aggregates tests
* Add LemmyResult to person_aggregates tests
* Add LemmyResult to language tests
* Add LemmyResult to post_aggregates tests
* Add LemmyResult to db_schema comment tests
* Add LemmyResult to actor_language tests
* Add LemmyResult to vote_view tests
* Add LemmyResult to registration_application_view tests
* Add LemmyResult to private_message_view tests
* Add LemmyResult to private_message_report_view tests
* Add LemmyResult to post_report_view tests
* Add LemmyResult to comment_report_view tests
* Add LemmyResult to sitemap tests
* Replace .expect() with .unwrap()
* Format code
* Remove clippy::unwrap_used from activity tests
* Add diesel result in db_schema tests
* Format code
* Map to_bytes() error to LemmyErrorType
* Remove clippy::unwrap_used from error tests
* Removing a few more unwraps, and cleaning up language code.
* Replace map_err with unwrap_or_default
* Replace ok_or with and_then
---------
Co-authored-by: Dessalines <tyhou13@gmx.com>
* Adding a default_comment_sort_type column for local_site and local_user.
- Renamed SortType to PostSortType in the DB and code.
- Renamed references to default_sort_type to default_post_sort_type.
- Fixes#4128
* Renaming migration to current date.
* Simplifying PostSortType.
* Make sure you can view your moderated deleted and removed communities.
- The front end checks to see whether you are a mod, in order to be
able to restore deleted / removed communities. This removes a filter
which prevents that.
- Fixes#4911
* Only show deleted communities to creator, and removed to admins.
* Addressing PR comments.
* Adding checks for higher admin and mod.
* Adding admin/mod checks for ban and comment removal.
* Combining mod or admin check with an SQL union.
* Making community ban or add mod also allow higher admins.
* Making sure remove post also checks higher mods or admins.
* Add unit test for is_higher_mod_or_admin_check
* Fixing comment.
* Addressing PR comments.
* Get rid of pointless wrapper functions, return lemmyresult directly.
* Fixing not being able to create comments on local community posts.
- This was caused by not passing my_person_id into various
`CommentView::read` functions.
- Fixes#4853
* Refactoring views to use local_user, rather than person
* Addressing PR comments.
* Fixing API tests.
* Prevent bot replies from increasing unread reply count when bot accounts are not shown
* Pass LocalUser for unread replies count query
* Prevent bot mentions from increasing unread reply count when bot accounts are not shown
* Dont show replies / mentions from blocked users. Fixes#4227
* Adding unit tests for reply and mention views.
- Also cleaned up some unwraps in the tests.
* Add allow deprecated to pass clippy for deprecated wav crate.
---------
Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
- 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
* Adding listMedia endpoint, to view all your local image uploads.
- Fixes#4445
* Fix ts import.
* Forgot to order by published desc
* Adding an endpoint to list all images, for admins only.
* Forgot to add file.
* Add additional test.
* Use better logic for no-limit version.
* Better call sites.
* Adding another test.
* Fix tests.
* Moving list_media to /account action.
* Addressing PR comments.
* Removing pointless comment.
---------
Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
* 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
* Make it so the signed in user can see if they're banned from a community
* Use more appropriate field name
---------
Co-authored-by: SleeplessOne1917 <insomnia-void@protonmail.com>
* 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
* Adding creator_is_admin to PersonView, CommentView, and PostView.
* Removing left joins from comment_view.
* Removing joins from person_mention and comment_reply views.
* Removing extra left join from person_view.
* Reverting some changes in post_view.
* Fixing compile error.
* User can block instances (fixes#2397)
* update comments
* review comments
* use route
* update
* add api test
* update tests
* fix
* fix test
* ci
---------
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>