-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Notifier] Add Mastodon Notifier #48101
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
Conversation
Hey! Thanks for your PR. You are targeting branch "6.2" but it seems your PR description refers to branch "6.3". Cheers! Carsonbot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thanks for working on this!
Up to add MastodonOptions to allow attaching media to toots as I did for the Twitter notifier?
src/Symfony/Component/Notifier/Bridge/Mastodon/Tests/MastodonTransportFactoryTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Notifier/Bridge/Mastodon/Tests/MastodonTransportFactoryTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Notifier/Bridge/Mastodon/MastodonTransport.php
Outdated
Show resolved
Hide resolved
I will check also like you did @nicolas-grekas in TwitterOptions to upload medias using https://docs.joinmastodon.org/methods/statuses/media/ |
src/Symfony/Component/Notifier/Bridge/Mastodon/MastodonTransport.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Notifier/Bridge/Mastodon/MastodonTransport.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, thanks!
Can you please open a doc and a recipe PR? Thanks 👏
@OskarStark PRs open! symfony/symfony-docs#17411 Regards |
We need to wait until |
src/Symfony/Component/Notifier/Bridge/Mastodon/MastodonOptions.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Notifier/Bridge/Mastodon/MastodonTransport.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Notifier/Bridge/Mastodon/MastodonTransport.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Notifier/Bridge/Mastodon/MastodonTransport.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Notifier/Bridge/Mastodon/Tests/MastodonTransportTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Notifier/Bridge/Mastodon/Tests/MastodonTransportFactoryTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Notifier/Bridge/Mastodon/MastodonOptions.php
Outdated
Show resolved
Hide resolved
Thanks for this PR! One key feature of Mastodon is that it is decentralized and supports the ActivityPub open standard (https://docs.joinmastodon.org/spec/activitypub/), so I wonder if we shouldn't use the ActivityPub API they provide instead of the "custom" endpoint. This would allow the Notifier component to support any app from the Fediverse (WriteFreely, Pleroma, PixelFed, WordPress with the ActivityPub plugin...) and even Symfony apps supporting ActivityPub through API Platform ActivityPub. The request to do looks like this: https://www.w3.org/TR/activitypub/#create-activity-outbox The only issue is for images. ActivityPub expects the image to be already hosted somewhere or to use an extension to upload it: https://www.w3.org/wiki/SocialCG/ActivityPub/MediaUpload WDYT? |
I think we can do both :) |
Really cool :) |
src/Symfony/Component/Notifier/Bridge/Mastodon/MastodonTransport.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Notifier/Bridge/Mastodon/MastodonTransport.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Notifier/Bridge/Mastodon/MastodonTransport.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor things and good to go on my side, thanks!
src/Symfony/Component/Notifier/Bridge/Mastodon/MastodonTransport.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Notifier/Bridge/Mastodon/MastodonTransport.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Notifier/Bridge/Mastodon/Tests/MastodonTransportTest.php
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready for merge.
I just force-pushed the following changes:
- fixed the rebase + squashed
- removed
MastodonOptions::media()
- use
/api/v2/media
instead of the deprecated/api/v1/media
- fixed using multipart form data for uploading media
Build should be green after another rebase @nicolas-grekas, I fixed a failing test in line notifier 👍🏻 |
Thank you @qdequippe. |
thank you @nicolas-grekas @OskarStark for your help |
This PR was submitted for the 6.2 branch but it was squashed and merged into the 6.3 branch instead. Discussion ---------- Add Mastodon bridge PR related symfony/symfony#48101 Commits ------- 79e9e47 Add Mastodon bridge
Migrate from Twitter with this new Symfony Notifier Bridge for Mastodon :)