* Add report_counts to post and comment aggregate tables.
- This adds a report_count and unresolved_report_count to
the post and comment aggregate tables.
- Useful for front-ends wishing to show report links.
- Fixes#4163
* Updating the historical counts.
* Switching from bigint to smallint.
* Using dullbananas create_trigger function.
* Removing a few expects from production and test code.
- Fixes#5192
* Using if let filter for admin emails.
* Fixing unused error.
* Adding expect_used = deny to clippy lints.
* Update src/lib.rs
Co-authored-by: Nutomic <me@nutomic.com>
* Update crates/utils/src/settings/structs.rs
Co-authored-by: Nutomic <me@nutomic.com>
* Update crates/utils/src/settings/mod.rs
Co-authored-by: Nutomic <me@nutomic.com>
* Some more cleanup.
* Fix clippy
---------
Co-authored-by: Nutomic <me@nutomic.com>
* Removing a few SuccessResponses for PostHide and MarkPostAsRead.
- This also removes the pointless multiple post_ids. These can be done
as individual calls on the front end anyway.
- Fixes#4755
* Fixing federation tests.
* Upgrading lemmy-js-client deps.
* Add ability to mark several posts as read.
Context:
- https://github.com/LemmyNet/lemmy/pull/5043
- https://github.com/LemmyNet/lemmy/issues/4755
- https://github.com/LemmyNet/lemmy/pull/5160
* Simplifying forms.
* Fixing forms.
* Cleanup post action forms by using derive_new defaults.
- Fixes#5195
* Fix ntfy to notify on success builds also.
* Removing pointless naive_now function.
* Running taplo fmt.
* Add user setting to auto-mark fetched posts as read.
- Rather than apps collecting up viewed posts ids, and sending many
mark as read requests, users can now turn this setting on, and any
results from /post/list will be auto-marked as read.
- Fixes#5144
* Adding list_post request option to auto-mark as read.
* Moving db_perf to before federation tests.
* Fixing lemmyerrortype import.
* Fixing ts_option.
* Fix clippy.
* Fix override logic.
* Revert "Fix override logic."
This reverts commit 923d7f0eca.
* Changing name to mark_as_read
* Removing a few SuccessResponses for PostHide and MarkPostAsRead.
- This also removes the pointless multiple post_ids. These can be done
as individual calls on the front end anyway.
- Fixes#4755
* Fixing federation tests.
* Upgrading lemmy-js-client deps.
* Simplifying forms.
* Fixing forms.
* Removing indexing slicing from a test.
* 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>
* Adding community description in addition to sidebar, like site.
- Also made changes to lemmy's group apub to be similar to its site,
which uses content for the sidebar, and summary for the short
description.
- Fixes#5078
* Fixing tests.
* Remove comment.
* Fix name for description checker.
* 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>
* Post scheduling (fixes#234)
* clippy
* replace map_err with inspect_err
* ignore unpublished posts in read queries
* add api test
* fmt
* add some checks
* address some review comments
* allow updating schedule time
* rewrite scheduled task
* fmt
* machete
* compare date in sql, more filters
* check for community ban in sql
* remove api test (scheduled task only runs every 10 mins)
* remove mut
* add index
* remove Post::read impl
* fmt
* fix
* correctly handle changes to schedule time
* normal users can only schedule up to 10 posts
* Adding saved_only, liked_only, and disliked_only filters to search.
- Fixes#4547
* Removing duplicate Url return type for search (was actually post).
- This now works like the post_title_only filter.
* Address PR comments.
* Add saved_only post_view test.
* Add custom_emoji list route
* Add tagline list route
* Apply linting
* Remove unecessary TaglineView
* Add category filter for custom emoji
* Add create tagline endpoint
* Add update tagline endpoint
* Add delete tagline endpoint
* Format through lint.sh
* Remove custom_emojis and taglines from site resource
* Get random tagline on site requets
* Impl Crud for Tagline
Remove superfluous properties
* Move tagline endpoints under /admin
* Impl Crud for CustomEmoji
* Remove delete from tagline and custom emoji impls
* Check markdown for tagline
* Validate markdown on tagline
* Make content fields non optional
Add error types for tagline validation
* Use process_markdown instead of process_markdown_opt
* Consolidate Tagline error types
* Remove unecessary clone
* Updat misleading comments
* Remove local_site_id from tagline and custom_emoji
* Update TaglineInserForm and TaglineUpdateForm
* Add ignore_page_limits for custom emojis
EmojiPicker needs to be able to retrieve all emojis in 1 call
* Update custom_emoji_view
Only keep get_all als helper function calling list with paging ignored
Only order on category when filtering on category
* Removing pointless get_all fn.
* remove tagline length checks
* make fields of TaglineInsertForm and TaglineUpdateForm mandatory
* move emoji order statement
* add comment for GetSiteResponse.tagline
---------
Co-authored-by: Freakazoid182 <>
Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
Co-authored-by: Dessalines <tyhou13@gmx.com>
Co-authored-by: Felix Ableitner <me@nutomic.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.
* Added OAUTH2 OIDC support
* Fixes and improvements based on review feedback
* use derive_new::new instead of TypedBuilder
* merge migrations into a single file
* fixes based on review feedback
* remove unnecessary hostname_ui config
* improvement based on review feedback
* improvements based on review feedback
* delete user oauth accounts at account deletion
* fixes and improvements based on review feedback
* removed auto_approve_application
* support registration application with sso
* improvements based on review feedback
* making the TokenResponse an internal struct as it should be
* remove duplicate struct
* prevent oauth linking to unverified accounts
* switched to manually entered username and removed the oauth name claim
* fix cargo fmt
* fix compile error
* improvements based on review feedback
* fixes and improvements based on review feedback
---------
Co-authored-by: privacyguard <privacyguard@users.noreply.github.com>
* Add option to search exclusively by post title
* Address format issues
* Remove duplicated 'removed' filter
* Replace url_search with search_term
* Build generic PostQuery before search match
* Create default queries. Move title_only to Search struct. Rename Url to PostURL
* Revert PostUrl to Url
* 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.
* Adding a show_read override to GetPosts.
- If show_read is true, it overrides the local user show_read
setting.
- Fixes#4124
* Addressing PR comments.
* Update crates/db_views/src/post_view.rs
Co-authored-by: dullbananas <dull.bananas0@gmail.com>
* Fixing formatting.
---------
Co-authored-by: dullbananas <dull.bananas0@gmail.com>
* Adding an image_details table to store image dimensions.
- Adds an image_details table, which stores the height,
width, and content_type for local and remote images.
- For LocalImages, this information already comes back with
the upload.
- For RemoteImages, it calls the pictrs details endpoint.
- Fixed some issues with proxying non-image urls.
- Fixes#3328
- Also fixes#4703
* Running sql format.
* Running fmt.
* Don't fetch metadata in background for local API requests.
* Dont export remote_image table to typescript.
* Cleaning up validate.
* Dont proxy url.
* Fixing tests, fixing issue with federated thumbnails.
* Fix tests.
* Updating corepack, fixing issue.
* Refactoring image inserts to use transactions.
* Use select exists again.
* Fixing imports.
* Fix test.
* Removing pointless backgrounded metadata generation version.
* Removing public pictrs details route.
* Fixing clippy.
* Running prettier.
* A few more fixes.
* Moving diesel schema check back down.
* Addressing PR comments.
* Changing back request head to get.
* Fixing lockfile.
---------
Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
* 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>