Skip to content

[Notifier] Add Matrix bridge #59377

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
Feb 14, 2025
Merged

[Notifier] Add Matrix bridge #59377

merged 1 commit into from
Feb 14, 2025

Conversation

chii0815
Copy link
Contributor

@chii0815 chii0815 commented Jan 6, 2025

Q A
Branch? 7.3
Bug fix? no
New feature? yes
Deprecations? no
License MIT

Docs PR: symfony/symfony-docs#20548
Recipe PR: symfony/recipes#1374

Added a new notifier bridge for Matrix Synapse.

Whats implemented in this?

  • sends message to roomID when roomID or userID or roomAlias (see above) is given as recipient
  • fetches roomID of private room when userID is given as recipient, if no room is available it will be created and the recipiant will be invited to join
  • fetches roomID when roomAlias is given as recipient

Whats not implemented at the moment?

  • end-to-end encryption, all messages will be unencrypted even if E2E enabled in the room.

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 7.3 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@carsonbot carsonbot changed the title [WIP][Notifier] Add Matrix Synapse bridge [Notifier] [WIP] Add Matrix Synapse bridge Jan 6, 2025
@chii0815 chii0815 changed the title [Notifier] [WIP] Add Matrix Synapse bridge [Notifier] Add Matrix Synapse bridge Jan 8, 2025
Copy link
Member

@xabbuh xabbuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also expand the UnsupportedSchemeException and its test in the Notifier component

@chii0815
Copy link
Contributor Author

chii0815 commented Jan 9, 2025

please also expand the UnsupportedSchemeException and its test in the Notifier component

Did in one of my last commits.

@chii0815
Copy link
Contributor Author

Not quite out of topic but would it be ok to add a console command that helps with creating and getting the ACCESS_TOKEN interactiv as it is suggested by Matrix Synapse API?

As the token is normaly bound to a client device and the instruction in README.md will provide the token of the client device 'incomnito browser'. Thats not very helpful if the user want's to use multiple instances (botusers / devices ) as they will need to do this for every token.

private function createPrivateChannel(string $recipientId): ?array
{
$invites[] = $recipientId;
$response = $this->request('POST', '/_matrix/client/v3/createRoom', ['json' => ['creation_content' => ['m.federate' => false], 'is_direct' => true, 'preset' => 'trusted_private_chat', 'invite' => $invites]]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using multiline here makes sense to me, no need for a one liner in this case

@fabpot
Copy link
Member

fabpot commented Feb 14, 2025

Thank you @chii0815.

@fabpot fabpot merged commit a90bd41 into symfony:7.3 Feb 14, 2025
1 check was pending
nicolas-grekas added a commit that referenced this pull request Feb 14, 2025
… (xabbuh)

This PR was merged into the 6.4 branch.

Discussion
----------

[WebProfilerBundle] fix rendering notifier message options

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #59377 (comment)
| License       | MIT

Commits
-------

d4e8a5c fix rendering notifier message options
fabpot added a commit that referenced this pull request Feb 14, 2025
…tions (xabbuh)

This PR was merged into the 7.3 branch.

Discussion
----------

[Notifier] do not implement JsonSerializable in MatrixOptions

| Q             | A
| ------------- | ---
| Branch?       | 7.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #59377 (comment)
| License       | MIT

Commits
-------

1af047d do not implement JsonSerializable in MatrixOptions
OskarStark added a commit to symfony/symfony-docs that referenced this pull request Feb 17, 2025
This PR was squashed before being merged into the 7.3 branch.

Discussion
----------

[Notifier] Add Matrix bridge

Doc PR for
* symfony/symfony#59377

Commits
-------

03b1ed9 [Notifier] Add Matrix bridge
@fabpot fabpot mentioned this pull request May 2, 2025
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.

5 participants