telegram icon indicating copy to clipboard operation
telegram copied to clipboard

Double-puppeted user leaving relaybotted Telegram group causes non-propagated messages

Open zouppen opened this issue 3 years ago • 1 comments

Steps to reproduce:

  1. User logins to the bridge
  2. User joins a matrix room which is relaybotted by the same mautrix-telegram instance
  3. User leaves the room from Telegram
  4. User writes to the Matrix room
  5. Messages are not relaybotted to Telegram

What should happen:

  • Message is relayed to Telegram using the relaybot

The only way to fix this currently seems to be manipulating the database directly like this: DELETE FROM user_portal where "user"=user_id and portal=portal_id;.

This issue has been briefly discussed on the chat room on 2022-01-19.

zouppen avatar Jan 19 '22 17:01 zouppen

Since leaving the Telegram chat caused inconsistencies, I think that the solution should be to bridge the leave from Telegram to matrix (via double puppeting). Alternatively, the relaybot could re-invite the user to Telegram, but that's hardly the intention the user had when they left the group.

To achieve what you're promoting, you probably need to bridge the event if the user leaving the chat by running this function: https://github.com/mautrix/telegram/blob/436781215f55fa8c73aa348985c7687930e11712/mautrix_telegram/user.py#L919

Which probably isn't too hard to do if you can figure out how Telegram expresses said event.

maltee1 avatar Mar 21 '23 15:03 maltee1