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

Telegram: Partial-Quote-Reponses aren't properly handled. #2203

Open
BenWiederhake opened this issue Dec 12, 2024 · 2 comments
Open

Telegram: Partial-Quote-Reponses aren't properly handled. #2203

BenWiederhake opened this issue Dec 12, 2024 · 2 comments
Labels

Comments

@BenWiederhake
Copy link
Contributor

Describe the bug
When responding to a partial message quote, matterbridge sends garbage to discord, and it fails. Excerpt from my logs:

time="2024-12-12T22:01:13+01:00" level=debug msg="=> Receiving config.Message{Text:"<mycensoredtext>", Channel:"mycensoredchannel", Username:"mycensoredname", UserID:"123456789", Avatar:"https://mycensored.example.com/mb/abcd1234/123456789.png", Account:"telegram.mytelegram", Event:"", Protocol:"telegram", Gateway:"mycensoredgw", ParentID:"telegram 6185", Timestamp:time.Date(2024, time.December, 12, 22, 1, 13, 115482686, time.Local), ID:"", Extra:map[string][]interface {}{}}" func=Send file="/home/user/
workspace/go-matterbridge-myfork/bridge/discord/discord.go:254" prefix=discord
time="2024-12-12T22:01:13+01:00" level=debug msg="Broadcasting using token (API)" func=handleEventBotUser file="/home/user/workspace/go-matterbridge-myfork/bridge/discord/discord.go:290" 
prefix=discord
time="2024-12-12T22:01:13+01:00" level=debug msg="=> Send from telegram.mytelegram (-1001234567890) to discord.mydiscord (mycensoredchannel) took 186.837392ms" func=func1 file="/home/user/workspace/go-matterbridge-myfork/gateway/gateway.go:508" prefix=gateway time="2024-12-12T22:01:13+01:00" level=error msg="SendMessage failed: HTTP 400 Bad Request, {"message": "Invalid Form Body", "code": 50035, "errors": {"message_reference": {"message_id": {"_errors": [{"code": "NUMBER_TYPE_COERCE", "message": "Value \"telegram 6185\" is not snowflake."}]}}}}" func=handleMessage file="/home/user/workspace/go-matterbridge-myfork/gateway/handlers.go:228" prefix=gateway

To Reproduce
Steps to reproduce the behavior:

  • Write a message on Telegram, let it be bridged by matterbridge to discord, for example "Hello humans how are you today"
  • On Telegram (e.g. using the "Web A" client at https://web.telegram.org/a/) respond only to a part of the message. (For example selecting the word "humans", right-clicking it, and selecting "Quote & Reply", then typing a message like "But I'm a robot-cat-ninja, not a human! 🤪", and sending it)
  • I think that PreserveThreading is involved in this issue.

Expected behavior
The second message should arrive just fine, either as a reply, or as a regular message (in the worst case).

Actual behavior: See above; an error message is logged, but the message is lost.

Screenshots/debug logs

The screenshots are specific to the "Web A"-client, and some clients don't support sending such messages. However, most clients support displaying these messages perfectly correctly; all clients display the main reply text, at least.

Bildschirmfoto_2024-12-12_22-20-41

Bildschirmfoto_2024-12-12_22-21-30

Environment (please complete the following information):

Additional context

[telegram.mytelegram]
Token="lolnope"
RemoteNickFormat="{NICK}@<U+200D>{PROTOCOL}: "
MediaConvertWebPToPNG=true
MediaConvertTgs="png"
UseFirstName=true
PreserveThreading=true
# Disable qoute-by-copy, because of PreserveThreading=true in Discord:
QuoteFormat="{MESSAGE}"

[discord.mydiscord]
Token="lolnope"
Server="Unfaßbare Menschen"
# No trailing colon-space!
RemoteNickFormat="{NICK}@<U+200D>{PROTOCOL}"
AutoWebhooks=true
PreserveThreading=true
@weskerty
Copy link

AutoWebhooks=true is fail.
There is a request to fix the problem, if the dkscord images are too important for you, you can fork it with the modification.
I hope the owner updates this repo when he has time.

@BenWiederhake
Copy link
Contributor Author

I don't understand what you're saying.

  • What is wrong with "AutoWebhooks=true"? That part works fine for me. Why is this relevant here, in your eyes?
  • Which PR do you mean, or what does "request to fix the problem" mean?
  • Why do you bring up images? This issue is about text-only.

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

No branches or pull requests

2 participants