Skip to content
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

Add support for m.tombstone events in the matrix connector #1264

Open
Cadair opened this issue Nov 22, 2019 · 6 comments
Open

Add support for m.tombstone events in the matrix connector #1264

Cadair opened this issue Nov 22, 2019 · 6 comments

Comments

@Cadair
Copy link
Contributor

Cadair commented Nov 22, 2019

When a matrix room is upgraded a m.tombstone event is emitted, with a link to the upgraded room. The matrix connector should automatically follow this link and join the new room and continue as normal.

@jacobtomlinson
Copy link
Member

What happens if a bot misses this event (restart, downtime, etc)? Is there a way it can also query a room on startup to see if it has been upgraded?

@Cadair
Copy link
Contributor Author

Cadair commented Nov 22, 2019

Yeah, I meant to add that, it should in theory come down in the initial sync everytime the bot starts, so it should also check for that as well.

@jacobtomlinson
Copy link
Member

Ok! Sounds good.

@geekypathak21
Copy link
Contributor

geekypathak21 commented Feb 25, 2020

Hey @Cadair I want to work on this issue can you please explain that I need to add new event for connector in this

from opsdroid.events import Event
or anything else we have to do.

@Cadair
Copy link
Contributor Author

Cadair commented Feb 26, 2020

There are a few components to this.

  1. Emitting and sending tombstone events. This requires you to add an event class in matrix/events.py modify the event creator to emit that event as it comes down sync, and then write a handler on the connector to send a tombstone state event into the room.
  2. Reacting to room upgrades. The real reason for tombstone events is almost always that the room has been upgraded. (See https://matrix.org/docs/spec/client_server/latest#id160) What we want to happen when the room is upgraded is that the bot seamlessly joins the new room and carries on.
  3. Emitting room upgrades. This is probably more niche. The bot would need to do be able to send the POST api call for room upgrades. Sending a tombstone event isn't the same as upgrading the room, so we would probably want a new event for an upgrade. Also receiving a tombstone, isn't always an upgrade, so we would need to think about that as well.

@Cadair
Copy link
Contributor Author

Cadair commented Jan 21, 2021

Implementing this also requires adding support for it in the matrix-nio library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants