Commit Graph

50 Commits

Author SHA1 Message Date
nutomic bd0e69b2bb Various things refactored (#95)
Remove unused derive macros

lemmy_rate_limit doesnt depend on lemmy_api_structs anymore

Dont use "pub extern crate"

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/95
2020-09-03 19:45:12 +00:00
Dessalines 2aaf4228ac
Local timeline (#1111)
* Adding a local filter. Fixes #1103

* Not showing local if there are no federated instances.
2020-09-03 09:58:33 -04:00
Dessalines 4a4629763e Fixing user search leaking emails. 2020-09-03 08:48:26 -05:00
Dessalines 7101ac1b4b Merge branch 'main' into fix_docker_caching 2020-09-03 08:06:05 -05:00
Dessalines e3140235de Use romacs cargo-build-deps tool. 2020-09-02 10:42:48 -05:00
Dessalines dfa9cb57aa Running cargo +nightly fmt. 2020-09-01 16:44:56 -05:00
Felix Ableitner 5d64dfd4dc Remove wildcard imports (in particular super::*) 2020-09-01 15:20:22 +02:00
nutomic d4dccd17ae implement ActivitySender actor (#89)
Merge pull request 'Adding unique ap_ids. Fixes #1100' (#90) from unique_ap_ids into activity-sender

Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/90

Adding back in on_conflict.

Trying to add back in the on_conflict_do_nothing.

Trying to reduce delay time.

Removing createFakes.

Removing some unit tests.

Adding comment jest timeout.

Fixing tests again.

Fixing tests again.

Merge branch 'activity-sender' into unique_ap_ids_2

Replace actix client with reqwest to speed up federation tests

Trying to fix tests again.

Fixing unit tests.

Fixing some broken unit tests, not done yet.

Adding uniques.

Adding unique ap_ids. Fixes #1100

use proper sql functionality for upsert

added logging

in fetcher, replace post/comment::create with upsert

no need to do an actual update in post/comment::upsert

Merge branch 'main' into activity-sender

implement upsert for user/community

reuse http client

got it working

attempt to use background-jobs crate

rewrite with proper error handling and less boilerplate

remove do_send, dont return errors from activity_sender

WIP: implement ActivitySender actor

Co-authored-by: dessalines <dessalines@noreply.yerbamate.dev>
Co-authored-by: Dessalines <tyhou13@gmx.com>
Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/89
2020-08-31 13:48:02 +00:00
Joshua Thomas 0f8372c0fb
Bugfix: Adds case-insensitive SELECT queries to User_::find_by_username() (#1108) 2020-08-28 20:49:31 -04:00
Dessalines ae39ddf031 Fixing some formatting. 2020-08-17 16:52:01 -04:00
Dessalines 3301e0ba50 Merge remote-tracking branch 'yerba/main' into main 2020-08-17 16:50:21 -04:00
nutomic ed72b096b9 Remove tests for unimplemented Crud::delete functions (#87)
Remove tests for unimplemented Crud::delete functions

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/87
2020-08-17 20:50:44 +00:00
Dessalines c323ab5275
Added option to remove banned user data (posts, comments, communities) (#1093)
- Works for both a site-ban, and a community ban.
- Fixes #557
2020-08-17 18:12:36 +00:00
Dessalines abadc79756 Fix community_view clippy 2020-08-16 11:27:50 -04:00
Dessalines 7f97279c48
Fixing community search. Fixes #1084 (#1089) 2020-08-16 11:05:21 -04:00
Dessalines 8c7c1f204c
Add a fix for double posts / comments. #1080 (#1081)
* Add a fix for double posts / comments. #1080

* Adding a comment.

* Moving upserts to lemmy_db.
2020-08-13 15:48:10 +00:00
Dessalines c19dfdae64 Fix formatting. 2020-08-12 10:45:04 -04:00
nutomic a496d8af65 Implement undo<dislike> for activitypub (#83)
Merge branch 'main' into undo-dislike

Implement undo<dislike> for activitypub

Fix some TODOs in activitypub code

Add post_read back in, do some cleanup

Add some delete functions back in

Merge branch 'main' into remove-dead-code

Replace body of unused db functions with unimplemented!()

Remove dead code

Remove remaining usages of unwrap() from activitypub code

Remove most usage of Option::unwrap() from activitypub code

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/83
2020-08-12 14:43:45 +00:00
Dessalines 8ee6f852cb Some formatting of post.rs 2020-08-12 08:31:05 -04:00
nutomic aace1bd71e Remove dead code (#81)
Add post_read back in, do some cleanup

Add some delete functions back in

Merge branch 'main' into remove-dead-code

Replace body of unused db functions with unimplemented!()

Remove dead code

Remove remaining usages of unwrap() from activitypub code

Remove most usage of Option::unwrap() from activitypub code

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/81
2020-08-12 12:30:52 +00:00
Dessalines 221db1bd1b Add email overwrite on user settings save. Fixes #1069
- Also add get_user_secure to other locations.
2020-08-08 22:36:29 -04:00
eiknat 492e8ad655 user_view: add fn to return sanitized fields 2020-08-07 22:43:33 -04:00
Dessalines 464ea862b1
Preferred usernames, banners and icons. (#1055)
* Re-organizing federation tests. #746 #1040

* Adding federation support for user bios. Fixes #992

* Adding icons, banners, and preferred usernames.

- Added optional community icons, and community banners.
- Added user banners.
- Added Site icon and banner, with custom favicon.
- Set up preferred usernames. Fixes #1017
- Added an additional post sort: Active
  - Hot rank now uses the published time.
  - Active uses the most recent comment time, and is default.
- DB Migration was required to add all these fields to the views.
- Added transfercommunity helper function.
- Removed title column from communities page.
- Abstracted an image-upload-form.tsx, and a banner-icon-header.tsx
- Fixes #899

* Some navbar fixes.

* Fixing css

* Some fixes.

- Showing correct user icon and banner after save without page reload.
- Abstracting diesel update overwrite.
- Adding some docs.

* Adding @ when a user doesn't have a preferred username.
2020-08-05 12:03:46 -04:00
Dessalines e336e5bcc0
Re-organizing federation tests. #746 #1040 (#1047)
* Re-organizing federation tests. #746 #1040

* Add more checks in inbox, plus some refactoring (#76)

Merge branch 'main' into more-inbox-permissions

Move check_community_ban() into helper function

Move slur check into helper functions

Move Claims::decode and site ban check into helper function

Note: this changes behaviour in that site ban is checked in more
places now. we could easily add a boolean parameter
check_for_site_ban to get the previous behaviour back

Rewrite user_inbox and community_inbox in the same way as shared_inbox

Add check against instance allowlist etc in shared_inbox

Co-authored-by: dessalines <dessalines@noreply.yerbamate.dev>
Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/76

* Adding verbose to test results.

Co-authored-by: nutomic <nutomic@noreply.yerbamate.dev>
Co-authored-by: dessalines <dessalines@noreply.yerbamate.dev>
Co-authored-by: Felix Ableitner <me@nutomic.com>
2020-08-04 10:57:37 -04:00
Felix Ableitner 678e1fa927 Add community outbox (ref #1018) 2020-07-29 22:49:52 +02:00
Dessalines 1ed63e99d9 Fix post thumbnail_url to use full urls. Fixes #632 2020-07-28 11:42:40 -04:00
Dessalines d1342afe93
Remove extra jwt claims (for user settings) (#1025)
* Remove extra jwt claims (for user settings)

- The JWT token only contains the issuer, and your user id now.
- Now only a page refresh is necessary to pick up your settings on all
  clients, including theme, language, etc.
- GetSiteResponse now gives you your user and settings if logged in.
- Fixes #773

* Remove extra comment line, I tested nsfw

* Adding a todo to add a User_::readSafe()
2020-07-27 09:23:08 -04:00
Dessalines 5e5063cbdd Adding some helper functions. 2020-07-21 13:52:57 -04:00
Dessalines 4b6a762a56 Added an is_mod_or_admin function to Community 2020-07-21 10:15:17 -04:00
Dessalines 2eac037408 Adding post delete, remove, lock, and sticky. 2020-07-20 23:46:36 -04:00
Dessalines fd96dfdb5e Added comment delete, remove, read. 2020-07-20 21:37:44 -04:00
Dessalines ca7d2feedb Some GetUserDetails cleanup. 2020-07-20 15:32:15 -04:00
Dessalines 9bc6698f58 Added community delete and remove. 2020-07-20 13:37:39 -04:00
Dessalines a67f46bec5 EditUserMention changed to MarkUserMentionAsRead. 2020-07-20 10:56:40 -04:00
Dessalines 0a28ffb9c4 Private message delete and read extracted. 2020-07-20 00:29:44 -04:00
Dessalines 87202b4915 Fixing duplicate actor_id for community and user. Fixes #957 2020-07-19 13:12:42 -04:00
nutomic 77a2a5eb01 Update activitystreams library to latest version (#71)
Merge branch 'main' into more-upgrade-apub-3

Update activitystreams library to latest version

Remove remaining usages of old activitystreams library

Migrate community inbox and user inbox

Migrate private message

Migrate post

Migrate community activities

Migrate extensions to new activitystreams library

Co-authored-by: dessalines <dessalines@noreply.yerbamate.dev>
Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/71
2020-07-17 21:11:07 +00:00
Felix Ableitner 2d4c41d2be Convert comments to new apub lib (including comment activities) 2020-07-15 18:26:37 +02:00
Dessalines 9f36fd50b4
GetSite fixes. Fixes #975 (#978) 2020-07-15 10:00:55 -04:00
Dessalines fc15276c10
Don't allow duplicate community names in API. #957 (#974) 2020-07-15 09:55:38 -04:00
ryexandra 29037b4995
Security/fix permission bugs (#966)
* secure the `EditPost` API endpoint

* Check user is moderator in BanFromCommunity

* secure the `EditComment` API endpoint

* pass orig `read` prob when not explicitly updating it.

* Block random users from adding mods.

* use cleaner logic from `EditPost`

* prevent editing a community by a mod from transfering ownership to them

* secure `read` action in `EditPrivateMessage`

* Add check in UserMention

* only let the indended recipient mark as read

* simplify booleans to satisfy clippy

* requested changes + cargo +nightly fmt

* fix to pass federation tests for deleting comments and posts

Co-authored-by: chiminh <chiminh.tutanota.com>
Co-authored-by: Hex Bear <buildadangtrain@protonmail.com>
2020-07-14 09:17:25 -04:00
Dessalines ac56b57faa Merge branch 'fix-migrate-apub-lib' 2020-07-13 11:57:39 -04:00
Dessalines ea0881f87e Using community-link instead. 2020-07-13 10:39:15 -04:00
Dessalines 1b7a4ac090 Merge branch 'add_post_title_to_comments_view' of https://github.com/makigi-io/makigi into makigi-io-add_post_title_to_comments_view 2020-07-13 09:57:37 -04:00
Felix Ableitner bb3e29e5c4 Make reads from activitypub objects immutable 2020-07-13 15:56:58 +02:00
Dessalines 7556f8615f
Adding a community_name option to GetPosts /post/list . Fixes #800 (#942) 2020-07-13 09:50:13 -04:00
Dessalines a7c1c472fe
Fixing admin and mod sort order. Fixes #939 (#941) 2020-07-13 09:42:03 -04:00
Ernest e06d9a620c Add post title to user comments inbox view, comment_view, user_mention_view 2020-07-13 08:18:11 +02:00
Ernest b037ff922c Add post title to comments view #948 2020-07-12 17:26:10 +02:00
nutomic 80aef61aed Split code into cargo workspaces (#67)
More fixes

- fixed docker builds
- fixed mentions regex test
- fixed DATABASE_URL stuff
- change schema path in diesel.toml

Address review comments

- add jsonb column back into activity table
- remove authors field from cargo.toml
- adjust LEMMY_DATABASE_URL env var usage
- rename all occurences of LEMMY_DATABASE_URL to DATABASE_URL

Decouple utils and db

Split code into cargo workspaces

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/67
2020-07-10 18:15:41 +00:00