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

Encrypted messages edited in Matrix are prefixed with an Asterisk in Telegram #623

Closed
s3lph opened this issue May 27, 2021 · 5 comments
Closed
Labels
bug: defect Something isn't working and it never has worked

Comments

@s3lph
Copy link

s3lph commented May 27, 2021

Telegram already marks edited messages as edited. However, if a message in a bridged channel is edited on the Matrix side, for some reason the edited message on the Telegram side now starts with the string * , in addition to the edited marker (see screenshot below).

Expected Behavior

Screenshot of an edited Telegram message

Actual Behavior

Screenshot of an edited Telegram message, with a prepended asterisk

(Disregard the timestamp difference)

Steps to Reproduce

  1. Set up a bridged channel
  2. Write a message in Matrix
  3. Look at the sent message in Telegram
  4. Edit the message in Matrix
  5. Look at the message in Telegram again
  6. Note that there's * prepended to the message
@tulir
Copy link
Member

tulir commented May 27, 2021

Seems to work fine for me, is the bridge up to date?

@tulir tulir added bug: unclassified Something isn't working and it may or may not have worked in the past can't reproduce This bug could not be confirmed labels May 27, 2021
@s3lph
Copy link
Author

s3lph commented May 27, 2021

I only recently set the bridge up, pip install mautrix-telegram[all]==0.10.0rc1 in a python3.9 venv.

@s3lph
Copy link
Author

s3lph commented May 27, 2021

Config attached: config.yaml

@JuniorJPDJ
Copy link

What matrix client are you using?
Can you provide message and edit event json from matrix side?

@s3lph
Copy link
Author

s3lph commented May 29, 2021

Element on Android.

Original message (decrypted):

{
  "type": "m.room.message",
  "content": {
    "msgtype": "m.text",
    "body": "Test",
  },
  "room_id": "REDACTED"
}

Edit event (also decrypted)

{
  "type": "m.room.message",
  "content": {
    "msgtype": "m.text",
    "body": "* This is a Test",
    "m.relates_to": {
      "rel_type": "m.replace",
      "event_id": "REDACTED",
    },
    "m.new_content": {
      "msgtype": "m.text",
      "body": "This is a Test"
    }
  },
  "room_id": "REDACTED"
}

As you can see, the * is added by the client in the body (I assume this is a backward compat feature for clients that don't support editing messages), but the text that's supposed to be used is in m.new_content. I also saw that there is code in mautrix-python to handle this, but I didn't (yet) look too closely at the code.

@tulir tulir changed the title Messages edited in Matrix are prefixed with an Asterisk in Telegram Encrypted messages edited in Matrix are prefixed with an Asterisk in Telegram May 29, 2021
@tulir tulir added bug: defect Something isn't working and it never has worked and removed bug: unclassified Something isn't working and it may or may not have worked in the past can't reproduce This bug could not be confirmed labels May 29, 2021
tulir added a commit that referenced this issue Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: defect Something isn't working and it never has worked
Development

No branches or pull requests

3 participants