Commit Graph

29 Commits

Author SHA1 Message Date
Nutomic
f6f169b4eb
Rewrite remaining activities (#1712)
* Limit type/method visibility in apub code

* Simplify db_queries traits by removing generics

* Simplify delete activity implementation

* Rewrite delete activities

* Implement helper functions for websocket message sending

* When receiving delete reason as empty string, change to none

* Rewrite remaining activities

* Simplify inbox

* Remove struct ActivityCommonFields, derive ActivityFields trait instead

* Community should announce received activities to followers
2021-08-19 17:24:33 -04: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
Nutomic
353a1fe0a0
Rewrite activitypub following, person, community, pm (#1692)
* Rewrite following activities

* Rewrite person apub

* Rewrite community apub

* Rewrite private message activity sending
2021-08-12 08:48:09 -04:00
Dessalines
f54209c451
Running clippy --fix (#1647) 2021-07-05 16:07:26 +00:00
Dessalines
6d3778cafe Changing unwrap_default to unwrap_or(false) 2021-04-26 09:50:34 -04:00
Dessalines
f8cd6fd445 Making more fields optional in the API.
- Fixes #1569
2021-04-23 02:30:13 -04:00
Nutomic
65a11a7239
Use .map_err in api code (fixes #1573) (#1575)
* Use .map_err in api code (fixes #1573)

* forgot some
2021-04-16 09:10:43 -04:00
Nutomic
aa79c5131f
Implement federated bans (fixes #1298) (#1553)
* Implement federated bans (fixes #1298)

* mod actions should always be federated to affected user, in addition to followers

* Make Undo/Block work for remote mods

* clippy fix

* fix federation test

* vscodium doesnt auto-save changes...
2021-04-09 11:01:26 -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
Felix Ableitner
01fc1228d5 Fix API and clippy warnings 2021-03-29 20:55:08 +02:00
Felix Ableitner
249fcc5066 Split api crate into api_structs and api 2021-03-25 20:19:40 +01:00
Felix Ableitner
4f54108a9c Merge branch 'main' into federated-moderation 2021-03-19 17:11:34 +01:00
Dessalines
c3efb9f7cf Strictly typing DB id fields. Fixes #1498 2021-03-18 16:25:21 -04:00
Felix Ableitner
b3a5b4eb82 Refactor activitypub code 2021-03-17 18:12:37 +01:00
Felix Ableitner
b1ca85b910 Fix clippy warning 2021-03-11 18:18:01 +01:00
Dessalines
9cb4dad4b4 A first pass. 2021-03-10 23:43:11 -05:00
Dessalines
ddf4a667b1 ~80% done 2021-03-10 17:33:55 -05:00
Felix Ableitner
3ffae1f5b8 Allow adding remote users as community mods (ref #1061) 2021-03-09 18:14:15 +01:00
Andrew Yoon
e78ba38e94
Use URL type in most outstanding struct fields (#1468)
* Use URL type in most outstanding struct fields

This fixes all known remaining cases where url fields are stored as
plain strings, with the exception of form fields where empty strings
are used as sentinels (see `diesel_option_overwrite_to_url`).

Tested for regressions in the federated docker setup attempting to
exercise all changed fields, including through apub federation.

Fixes #1385

* Add migration to fix blank-string post.url values to be null

This also then fixes #602

* Address review feedback

- Fixed some unwraps and err message formatting
- Bumped the `url` library to 2.2.1 to fix a bug with serde error
  messages
- Add unit tests for the two diesel option override functions
- Fix migration teardown by adding a no-op

* Rename lemmy_db_queries::Url to lemmy_db_queries::DbUrl

* fix compile error

* box PostOrComment variants
2021-03-02 12:41:48 +00:00
Felix Ableitner
3bdd78f341 Rename lemmy_structs to lemmy_api_structs 2021-03-01 14:08:41 +01: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
Felix Ableitner
8096765f0e Fix clippy error upper_case_acronyms 2021-02-22 19:04:32 +01:00
nutomic
1a4e35eb50 Store activitypub endpoints in database (#162)
Address review comments

Store Activitypub urls in database (fixes #808)

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/162
Co-Authored-By: nutomic <nutomic@noreply.yerbamate.ml>
Co-Committed-By: nutomic <nutomic@noreply.yerbamate.ml>
2021-02-04 16:34:58 +00:00
Dessalines
cd08fdf76f Make sure banned users cant subscribe, and the ban unsubs them. Fixes #1324 2021-01-30 23:55:14 -05:00
Nutomic
3d578f9df2
Use Url type for ap_id fields in database (fixes #1364) (#1371) 2021-01-27 11:42:23 -05:00
Dessalines
cf911c023d
Add listing type to list communities (#1380)
* Adding listing type to ListCommunities. Fixes #1379

* Upgrading lemmy-js-client.
2021-01-26 12:18:01 -05:00
Felix Ableitner
3b64c58198 Move most code into crates/ subfolder 2021-01-20 16:21:27 +01:00