A reply in Matrix can already show up as a comment in Drupal. But whose comment is it?
In the last episode, I showed what it looks like when a Matrix room and a Drupal comment thread share a conversation. This time, I’m connecting the people on either side of it. If I reply from my Matrix client, Drupal should be able to show that reply under my Drupal account.
In episode 4, I install Matrix API Identity (matrix_api_identity), set up a fallback service user in Drupal, and walk through linking and verifying an existing Matrix account. Then I send messages from Matrix to show what Drupal does with senders it knows and senders it doesn’t.
What happens when Drupal doesn’t know the sender?
People in the Matrix room may never have signed in to the Drupal site. In the workflow I show, those messages can still come across. A dedicated Drupal service user gives the import somewhere to land when there’s no matching account. Once Drupal can match a sender to a verified account, the imported comment can be attributed to that person instead.
Proving a Matrix account is yours
Anyone can type a Matrix ID into a form. To prove it’s mine, I open the Matrix identities tab on my Drupal account and add my full Matrix ID, including the homeserver. The bot sends a confirmation link to that account in Matrix. I follow it back to Drupal and confirm the link while signed in to the same Drupal account that requested it.
Now when I reply in Matrix, the integration can look up the sender’s Matrix ID and attribute the new Drupal comment to the right account. For the Drupal Groups initiative, that’s what makes this feel like one discussion: I can reply from chat and still show up as myself on the website.
Next: sending to Matrix as yourself
Verifying an existing Matrix ID lets Drupal recognize who sent a message. It doesn’t give Drupal permission to send as that Matrix account. In episode 5, I’ll show the other direction: using OpenID Connect (OIDC) so people can sign in to Matrix with their Drupal account, provision a linked Matrix account, and send messages from Drupal under that Matrix identity.
Comments
0 comments
No comments yet.
No new comments remain in this discussion.
Add new comment