WIP: Activitystreams crate #27

Merged
elegaanz merged 4 commits from activitystreams into master 3 years ago
elegaanz commented 3 years ago (Migrated from github.com)
Owner

Still a lot of // TODO to resolve

Closes #17

Still a lot of `// TODO` to resolve Closes #17
asonix commented 3 years ago (Migrated from github.com)
Owner

Do you feel like using this crate is better than what you were doing before?

Is there anything that it doesn't do that you wish it did?

Do you feel like using this crate is better than what you were doing before? Is there anything that it doesn't do that you wish it did?
elegaanz commented 3 years ago (Migrated from github.com)
Poster
Owner

@asonix I think my code is more idiomatic now, and the way we are serializing/deserializing activities is really cleaner. One thing I would have liked to completely avoid, is to manipulate the JSON object directly (as I'm doing here, for instance, https://github.com/Plume-org/Plume/pull/27/files#diff-a244a0dbf50367a4f27f1f20df813475R48 because I didn't found any clean solution). But it globally nice to use, even if it is hard to have a nice API for ActivityStreams in Rust.

@asonix I think my code is more idiomatic now, and the way we are serializing/deserializing activities is really cleaner. One thing I would have liked to completely avoid, is to manipulate the JSON object directly (as I'm doing here, for instance, https://github.com/Plume-org/Plume/pull/27/files#diff-a244a0dbf50367a4f27f1f20df813475R48 because I didn't found any clean solution). But it globally nice to use, even if it is hard to have a nice API for ActivityStreams in Rust.
elegaanz commented 3 years ago (Migrated from github.com)
Poster
Owner

Actually an issue I'm encountering is that the ActivityPub spec adds some properties to actors, on top of those defined by ActivityStreams (inbox for instance). I don't know if there is a solution in your crate that I didn't find, but if not it would be nice to allow to add custom properties to actors (and why not any kind of object actually).

Actually an issue I'm encountering is that the ActivityPub spec adds some properties to actors, on top of those defined by ActivityStreams (`inbox` for instance). I don't know if there is a solution in your crate that I didn't find, but if not it would be nice to allow to add custom properties to actors (and why not any kind of object actually).
asonix commented 3 years ago (Migrated from github.com)
Owner

Yeah, custom properties is something that I've had trouble with figuring out. My method of doing it now is through the CustomLink and CustomObject types

You can do

CustomObject::new(your_base_object, your_extra_properties) and it will implement Object if your_base_object implements Object, actor if your_base_object implements Actor, etc.

Yeah, custom properties is something that I've had trouble with figuring out. My method of doing it now is through the CustomLink and CustomObject types You can do CustomObject::new(your_base_object, your_extra_properties) and it will implement Object if your_base_object implements Object, actor if your_base_object implements Actor, etc.
elegaanz commented 3 years ago (Migrated from github.com)
Poster
Owner

Nice! Thanks for your help.

Nice! Thanks for your help.
The pull request has been merged as d7552ba369.
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.