-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow creating posts #33
Comments
heh. the difficulty here is definitely where to deliver to, since bridgy fed is only a proxy. it doesn't actually know where a user's followers are. the current design is that followers' instances subscribe to user's atom feeds, OStatus style, with optional WebSub notifications. this obviously had problems, #18 etc. AP inbox delivery would be great, but i still don't quite see how yet. hard coding mastodon.social doesn't seem right. manually including all followers in every post doesn't either. |
Yeah, this is indeed a tricky one. So possibly a very stupid question: my atom feed (https://realize.be/fediverse.xml) uses https://bridgy-fed.superfeedr.com/ as the hub - I'm good at following setups heh. When I post something new, do I have to send a call to that hub to notify it exists ? I admit, I'm not entirely familiar with this hub and websub thing :/ If I understand it better, I can experiment more and have a better clue what to search for in mastodon's code :) |
@swentel heh, you're discovering all the embarrassing rough parts of bridgy fed. i don't think https://bridgy-fed.superfeedr.com/ actually does anything right now 😆. when i first tested with mastodon - before activitypub - its ostatus required a websub hub in the atom feed, so i registered with superfeedr and pointed people there. i don't actually know much about websub, or whether or how the hub matters to mastodon. sorry! |
Ah no problem at all :) Mastodon stores the hub, so I'll dig in and see if I can come up with something! |
@aaronpk recently open sourced his site's AP code! https://github.com/aaronpk/Nautilus . he does what we've discussed doing: store every user's followers and send new posts to their instances over AP. i was hoping to avoid that, since mastodon supposedly supports atom + websub, but in practice they've been difficult enough that maybe we should just plan to store followers and go full AP ourselves too. |
I'm looking into the atom + websub stuff now. Hopefully I can report back positive :) |
This is the minimal object I've send to post a 'toot'. It showed up in the home timeline of my swentel mastodon user, even though I didn't cc that user, or followers or so, but not sure if that's something we can rely on. Posted to the shared inbox of mastodon.social. However bottom line, it's like a reply, but without inReplyTo ... that is the easy part :)
|
Dit another one with |
@swentel agreed! you've probably already looked at them, but just in case, you may be interested in https://www.w3.org/TR/activitypub/#shared-inbox-delivery and other parts of the spec. |
…bject we don't create these any more, we always fetch and store full actor objects, but we have a few old ones lying around in the prod datastore. for #33
woo, this is working for original posts! example: https://mastodon.technology/web/statuses/101104510742043648 . (original post: https://snarfed.org/2018-11-10_30370 ) lots of polish remaining, of course. still, feel free to try if you want, @swentel! |
WOW! I WILL :) (I have an article ready on my blog to promote this too, I'll publish that even if one post works !) |
I've send a webmention for https://realize.be/notes/1638 - but not seeing anything in the logs of bridgy fed. Don't see an error on my end either, it even stores it as a 'send item' (Drupal specific implementation). Markup seems ok too. So not sure what goes wrong :) |
oops, thanks for the report! fixed, i think. i retried, but looks like you've deleted https://realize.be/notes/1638 . |
IT WORKS! https://mastodon.social/web/statuses/101104925308165944 - https://realize.be/notes/1638 |
yay! congrats! and oh wow, funny, that mastodon.social link literally redirects to your original post. federation indeed. 😎 |
Yes, that link only works in the UI of Mastodon, but that's totally fine. Did a test with https://realize.be/image/falling-leaves - which has an image, but that hasn't come through yet. This might call for a local debugging session :)
|
Ok regarding images. There might be two things:
Note - can also be a follow up, I can do some local testing and see what the format needs to be, I like figuring out those things :) |
As for p-summary - that works great - see https://mastodon.social/web/statuses/101105193204982078 |
No, the image doesn't show up. Only the url to the post itself. And about five minutes later, some sort of embed card appeared too, but it just links to the same original url. Looking at the logs, the image is found, so I think discovery is fine. It's mastodon that just doesn't like it right now. Maybe we should check with aaron if he does something specific with u-photo or not. |
Skimming through mastodons code, looks like images should be inside an 'attachments' property. |
yeah searching https://www.w3.org/TR/activitypub/ for image, attachment, and photo doesn't turn up anything useful. AP may defer it to AS2 and individual implementations. maybe we just do what works for Mastodon (and maybe soon PixelFed) for now. |
I was able to create a post with an image. Attachment is an array of arrays. The url is mandatory, name and focalPoint are optional. See https://mastodon.social/web/statuses/101114062630255773 I also tested with sending no content property and an attachment and that works fine too, so content isn't mandatory in case there are valid attachments.
For reference, the code from mastodon (app/lib/activitypub/activity/create.rb)
|
woo, that's great! thanks again. i'll incorporate that. |
done! example: https://mastodon.technology/web/statuses/101124703242866136 i think all that's left to do here is update the docs. |
Yes, works great! |
So replies work now, awesome!
A post is more or less the same as a reply with these differences:
another tricky part: fed bridgy doesn't really care to which federated service you want to post on. It could be diaspora or something else in the future too, so either
I will do some tests and see what the minimum object should be.
The text was updated successfully, but these errors were encountered: