Commit graph

54 commits

Author SHA1 Message Date
Nutomic ceff2ec686
Use enum for registration mode setting (#2604)
* Use enum for registration mode setting

* fix tests
2023-01-05 01:42:30 +00:00
Anon 9dfd819691
Add support for Featured Posts (#2585)
* Add support for Featured Posts

* Fix rebase

* More fixes
2022-12-12 11:17:10 +00:00
Nutomic d20d2b9218
Implement federated user following (fixes #752) (#2577)
* Implement federated user following (fixes #752)

* rewrite send_activity_in_community and add docs, remove default for column pending

* improve migration

* replace null values in db migration
2022-11-23 18:40:47 -05:00
Nutomic 872c60a013
Remove federation settings, rely on sensible defaults instead (#2574)
This affects federation_strict_allowlist and federation_http_fetch_retry_limit
2022-11-21 11:44:34 -05:00
Anon c27d2a5687
Add support for Taglines (#2548)
* Add support for Taglines

* recreate migration

* Update content column -> Text

* Optimize replace function

* Change taglines to Option

* Move Ok() call

* Move taglines to GetSiteResponse

* Fix logic

Co-authored-by: layla <layla@chapo.dev>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2022-11-19 09:48:29 -05:00
Dessalines 235cc8b228
Moving settings to Database. (#2492)
* Moving settings to Database.

- Moves many settings into the database. Fixes #2285
- Adds a local_site and instance table. Fixes #2365 . Fixes #2368
- Separates SQL update an insert forms, to avoid runtime errors.
- Adds TypedBuilder to all the SQL forms, instead of default.

* Fix weird clippy issue.

* Removing extra lines.

* Some fixes from suggestions.

* Fixing apub tests.

* Using instance creation helper function.

* Move forms to their own line.

* Trying to fix local_site_data, still broken.

* Fixing federation tests.

* Trying to fix check features 1.

* Addressing PR comments.

* Adding check_apub to all verify functions.
2022-10-27 09:24:07 +00:00
Nutomic 2ef0f8f5f8
implement language tags for site/community in db and api (#2434)
* implement language tags for site/community in db and api

* add api checks for valid languages

* during db migration, update existing users, sites, communities to have all languages enabled

* init new users/communities with site languages (not all languages)

* federate site/community languages

* fix tests

* when updating site languages, limit community languages to this subset

also, when making a new post and subset of user lang, community lang
contains only one item, use that as post lang

* add tests for actor_language db functions

* include language list in siteview/communityview

* Fix some of the review comments

* Some more review changes

* Add todo about boxed query

* Add default_post_language to GetCommunityResponse
2022-10-06 14:27:58 -04:00
Dessalines ae95f5928e
Adding email admins for new applications. Fixes #2271 (#2390)
* Adding email admins for new applications. Fixes #2271

* Fix error.

Co-authored-by: Nutomic <me@nutomic.com>
2022-09-27 12:48:44 -04:00
Dessalines 0aeb78b8f3
Showing # of unread comments for posts. Fixes #2134 (#2393)
* Showing # of unread comments for posts. Fixes #2134

* Fix lint.

* Forgot to remove comment list update.

* Fix clippy
2022-09-27 16:45:46 +00:00
Dessalines c9f1407429
Diesel 2.0.0 upgrade (#2452)
* Initial commit to bump diesel to 2.0.0-rc.0 and see what happens

* Add chrono feature from diesel

* db_schema crate is close to building?

* Upgrade diesel-derive-newtype

* Mostly modifying references to connections to be mutable ones; also used
new way to do migrations as suggested by the migration guide; a lot more
compiles now, though I can't figure out this tricky ToSql issue at the
moment

* Running clippy --fix

* Trying to fix drone clippy 1

* Fix clippy

* Upgrade clux-musl

* Trying to fix drone clippy 2

* Trying to fix drone clippy 3

* Trying to fix drone clippy 5

* Adding diesel table aliases, removing sql view hack. Fixes #2101

Co-authored-by: Steven Chu <stevenc1@gmail.com>
Co-authored-by: Nutomic <me@nutomic.com>
2022-09-26 14:09:32 +00:00
Nutomic 004efd5d94
Implement reports for private messages (#2433)
* Implement reports for private messages

* finish private message report view + test

* implement api for pm reports

* merge list report api calls into one, move report count to site

* fix compile error

* Revert "merge list report api calls into one, move report count to site"

This reverts commit 3bf3b06a705c6bcf2bf20d07e2819b81298790f3.

* add websocket messages for pm report created/resolved

* remove private_message_report_view

* add joinable private_message_report -> person_alias_1

* Address review comments
2022-09-19 22:58:42 +00:00
Felix Ableitner 3d0d8796ad Add language tags for comments 2022-09-02 10:49:54 -04:00
Nutomic e4a49b6eab
Tag posts and comments with language (fixes #440) (#2269)
* Tag posts and comments with language (fixes #440)

* Untangle PostView tests

* Implement test for PostView language query

* Store languages directly in database

* finish moving languages into db, it compiles

* update post_view

* serde skip Language.id field

* add local_user_language table, other changes suggested in review

* add code for local_user_discussion_language_view

* Remove unnecessary clones in db view converteres

* Fixing up some table and join issues.

* Clearing the current languages.

* Fix formatting.

* update user languages in single transaction

* proper test for user language queries

* Some fixes for all / missing user languages. (#2404)

* Some fixes for all / missing user languages.

* Adding back in transaction.

* fix test

Co-authored-by: Dessalines <tyhou13@gmx.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2022-08-18 15:11:19 -04:00
Dessalines 870abf8442
Adding distinguish comment. Fixes #2002 (#2391)
* Adding distinguish comment. Fixes #2002

* Adding lemmy:distinguished
2022-08-17 11:38:52 +00:00
Anon 21455d6b73
Add Modlog Filters (#2313)
* Fix crash running locally on windows.

* Add support for filtering mod logs

* Refactor cleanup

* Clippy fix

* Condense match statements

* Clippy fix 2
2022-08-16 11:52:04 +00:00
Dessalines 9c3efe32e7
First pass at adding comment trees. (#2362)
* First pass at adding comment trees.

- Extracted comment replies into its own table.
- Added ltree column to comment
- Added parent_id param to GetComments to fetch a tree branch
- No paging / limiting yet

* Adding child_count to comment_aggregates.

* Adding parent comment update counts

* Fix unit tests.

* Comment tree paging mostly done.

* Fix clippy

* Fix drone tests wrong postgres version.

* Fix unit tests.

* Add back in delete in unit test.

* Add postgres upgrade script.

* Fixing some PR comments.

* Move update ltree into Comment::create

* Updating based on comments.

* Fix send soft fail.
2022-07-30 05:55:59 +02:00
Dessalines 4e12e25c59
Adding admin purging of DB items and pictures. #904 #1331 (#1809)
* First pass at adding admin purge. #904 #1331

* Breaking out purge into 4 tables for the 4 purgeable types.

* Using CommunitySafe instead in view

* Fix db_schema features flags.

* Attempting to pass API key.

* Adding pictrs image purging

- Added pictrs_config block, for API_KEY
- Clear out image columns after purging

* Remove the remove_images field from a few of the purge API calls.

* Fix some suggestions by @nutomic.

* Add separate pictrs reqwest client.

* Update defaults.hjson

Co-authored-by: Nutomic <me@nutomic.com>
2022-06-13 19:15:04 +00:00
Nutomic 339eab01fd
Embed Peertube videos (#2261)
* Use og:video attribute for embeds, change Post.embed_html to embed_url

* fix clippy
2022-06-02 21:44:47 +00:00
Dessalines eafb3869f2
Revert "Add pending, and change use specific API response for FollowCommunity…" (#2283) 2022-05-26 11:17:04 -04:00
Dessalines d4ee171b08 Making community_follower.pending column not null. 2022-05-20 16:15:14 +00:00
Nutomic 9ef0efa420
Add legal information (fixes #721) (#2273) 2022-05-19 20:32:40 +00:00
Nutomic 7058cfa1cf
Implement restricted community (only mods can post) (fixes #187) (#2235)
* Implement restricted community (only mods can post) (fixes #187)

* review fixes

* fix tests
2022-04-28 20:32:32 +00:00
Nutomic 00b0b26dfa
Add default post listing type (fixes #2195) (#2209)
* Add default post listing type (fixes #2195)

* review fixes

* change column type
2022-04-19 19:05:08 +00:00
Nutomic 9f5183fe98
Add site option for default theme (#2104) 2022-02-23 11:40:36 -05:00
dayinjing 7f9b55e793
Hide community v2 (#2055)
* Initial working of hiding communities and adding a db entry for mod log

* Return mod log for hidden communities

* Clean up hidding communities PR

* use lower case like other migration files

* Formatting fix

* pass in admin id to list, make match logic the same in post_view as community_view. Dont force non null for reason

* Clean PR review stuff

* Change person_id to mod_person_id on hide community table

* Make bools optional, add a space for formating

Co-authored-by: Thor Odinson <odinson@asgard.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2022-02-18 02:30:47 +00:00
Nutomic dd865c5af5
Implement instance actor (#1798)
* Implement instance actor

* wip: make site bans federate

* finish implementation and unit tests for federated bans

* start adding api tests

* fix api test

* remve site from GetCommunityResponse

* only federate site bans originating from user's home instance

* dont expose site.private_key in api
2022-02-07 19:23:12 +00:00
Dessalines e36ad9d984
Removing the site creator, adding leave_admin. Fixes #1808 (#2052)
* Removing the site creator, adding leave_admin. Fixes #1808

* Making sure there's at least one admin. Fixing unit tests
2022-01-26 17:57:16 +00:00
Dessalines e65c45f152
Adding temporary bans. Fixes #1423 (#1999)
* Adding temporary bans. Fixes #1423

* Adding ban_expires to person

* Fix clippy

* Removing ban_expires from federated fields.

* Trying to add expires to blockcommunity apub.
2022-01-08 12:37:07 +00:00
Dessalines c883a49a40
First pass at invite-only migration. (#1949)
* First pass at invite-only migration.

* Implement email verification (fixes #219)

* remove unwrap

* Adding views and functionality to registration application. #209

* Add private instance site column, and back end checks.

* Adding some message fields to LoginResponse

* Adding private instance to site setup.

* A few additions:

- Add a DeleteAccount response.
- RegistrationApplicationView now has the safe LocalUserSettings.
- Adding VerifyEmail to websocket API, added a proper response type.

* Adding and reorganizing some email helpers.

* A few fixes for private sites:

- Added a check_registration_application function.
- Only send a verification email if its been changed.
- VerifyEmail now returns LoginResponse.
- Deleting the old tokens after a successful email verify.
- If port is missing on email config, display a better error message.

* Version 0.15.0-rc.3

* Adding published to email_verification table.

* Adding fixes from comments.

* Version 0.15.0-rc.4

* Adding modlog private site check.

* Version 0.15.0-rc.6

Co-authored-by: Felix Ableitner <me@nutomic.com>
2021-12-15 14:49:59 -05:00
Dessalines 3d08e6c1fc
Adding unique constraint for activity ap_id. Fixes #1878 (#1935)
* Adding unique constraint for activity ap_id. Fixes #1878

* Removing is_activity_already_known
2021-11-22 18:57:03 +00:00
Dessalines 05d43150bc Making public key required. Fixes #1934 2021-11-22 10:10:18 -05:00
Felix Ableitner cf214ff583 Move jwt secret from config to database (fixes #1728) 2021-09-27 11:25:09 +02:00
Dessalines 2016afc9db
User / community blocking. Fixes #426 (#1604)
* A first pass at user / community blocking. #426

* Adding unit tests for person and community block.

* Moving migration

* Fixing creator_blocked for comment queries, added tests.

* Don't let a person block themselves

* Fix post creator_blocked

* Adding creator_blocked to PersonMentionView

* Moving blocked and follows to MyUserInfo

* Rename to local_user_view

* Add moderates to MyUserInfo

* Adding BlockCommunityResponse

* Fixing name, and check_person_block

* Fixing tests.

* Using type in Blockable trait.

* Changing recipient to target, adding unfollow to block action.
2021-08-19 20:54:15 +00:00
Dessalines 6910e18a83 Adding ModTransferCommunity to modlog in API. Fixes #1437 2021-08-17 17:52:28 -04:00
Dessalines fcae2189eb
Add show_new_posts_notifs setting. Fixes #1664 (#1665) 2021-07-22 20:07:40 +00:00
Dessalines 5b2be6f9df Add show_read_posts filter. Fixes #1561 2021-04-24 18:26:50 -04:00
Nutomic db1abff857
Add option to limit community creation to admins only (fixes #1586) (#1587)
* Add option to limit community creation to admins only (fixes #1586)

* address review
2021-04-22 19:42:58 -04:00
Nutomic efee2062dd
Mark accounts as bot nutomic (#1565)
* Mark account as bot. Fixes #1357

* Fix clippy

* Federate bot status using actor `type` field

* fix clippy

Co-authored-by: Dessalines <tyhou13@gmx.com>
2021-04-21 17:41:14 -04:00
Dessalines c3d64f996e
Removing community.creator column. Fixes #1504 (#1541)
* Removing community.creator column. Fixes #1504

* Fixing unit tests.

* Fixing federation tests.
2021-04-08 11:29:08 +00:00
Dessalines 7bd474a843
Adding a short site description. Fixes #1496 (#1532)
* Adding a short site description. Fixes #1496

- Renaming old description to sidebar

* Adding a back end site desc length check.
2021-04-07 11:40:35 +00:00
Nutomic bcdbced0dd
Merge pull request #1536 from LemmyNet/change_preferred_to_display_name
Changing preferred to display name. Fixes #1211
2021-04-06 12:02:50 +00:00
Dessalines bf7558830f Changing preferred to display name. Fixes #1211 2021-04-01 13:57:45 -04:00
Dessalines 2f63fdbde0 Adding a setting to show / hide scores. Fixes #1503 2021-03-31 06:54:46 -04:00
Dessalines eb45bf2d0a Moving admin to person table. Fixes #1515 2021-03-22 10:28:00 -04:00
Dessalines 1745b64ceb Moving matrix_user_id to person table. #1438 2021-03-20 15:21:51 -04:00
Dessalines 05b485b678 Merge branch 'Mart-Bogdan-1462-jwt-revocation-on-pwd-change' into jwt_revocation_dess 2021-03-19 00:31:49 -04:00
Bogdan Mart ab947f1f08 User token revocation upon password change
Added DB column validator_time and chedking that is is less then token's "Issuead at time"
Wip on #1462
2021-03-13 20:16:35 +02:00
Dessalines ddf4a667b1 ~80% done 2021-03-10 17:33:55 -05:00
Dessalines a869a2823b Still continuing on.... 2021-02-26 08:49:58 -05:00
Felix Ableitner 3141ad31de Remove categories (fixes #1429) 2021-02-25 13:22:37 +01:00