Skip to content

[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

Merged
merged 1 commit into from
Dec 5, 2022
Merged

[Notifier] Add Mastodon Notifier #48101

merged 1 commit into from
Dec 5, 2022

Conversation

qdequippe
Copy link
Contributor

@qdequippe qdequippe commented Nov 3, 2022

Q A
Branch? 6.3
Bug fix? no
New feature? yes
Deprecations? no
Tickets
License MIT
Doc PR symfony/symfony-docs#17411
Recipe symfony/recipes#1141

Migrate from Twitter with this new Symfony Notifier Bridge for Mastodon :)

@carsonbot
Copy link

Hey!

Thanks for your PR. You are targeting branch "6.2" but it seems your PR description refers to branch "6.3".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

Copy link
Member

@nicolas-grekas nicolas-grekas left a 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?

@qdequippe
Copy link
Contributor Author

I will check also like you did @nicolas-grekas in TwitterOptions to upload medias using https://docs.joinmastodon.org/methods/statuses/media/

@wouterj wouterj modified the milestones: 6.2, 6.3 Nov 3, 2022
Copy link
Contributor

@OskarStark OskarStark left a 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 👏

@qdequippe
Copy link
Contributor Author

@OskarStark
Copy link
Contributor

We need to wait until 6.3 branch is created

@dunglas
Copy link
Member

dunglas commented Nov 4, 2022

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?

@nicolas-grekas
Copy link
Member

I think we can do both :)

@qdequippe
Copy link
Contributor Author

Really cool :)
Maybe an "option" in DSN? In this PR?

Copy link
Member

@nicolas-grekas nicolas-grekas left a 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!

@qdequippe qdequippe requested a review from yceruto as a code owner December 2, 2022 17:32
Copy link
Member

@nicolas-grekas nicolas-grekas left a 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

@OskarStark
Copy link
Contributor

Build should be green after another rebase @nicolas-grekas, I fixed a failing test in line notifier 👍🏻

@nicolas-grekas
Copy link
Member

Thank you @qdequippe.

@nicolas-grekas nicolas-grekas merged commit aee9ea5 into symfony:6.3 Dec 5, 2022
@qdequippe
Copy link
Contributor Author

thank you @nicolas-grekas @OskarStark for your help

@qdequippe qdequippe deleted the mastodon-notifier branch December 5, 2022 12:58
OskarStark added a commit to OskarStark/symfony-docs that referenced this pull request Dec 5, 2022
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
@fabpot fabpot mentioned this pull request May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants