42wim / matterbridge

bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API (mattermost not required!)
Apache License 2.0
6.59k stars 614 forks source link

WhatsApp quoted messages not displayed in telegram #2025

Open K3nn3th2 opened 1 year ago

K3nn3th2 commented 1 year ago

Describe the bug replying to /quoting a message in whatsapp only displays the reply in the linked telegram group and not the quoted message, while messages quoted in the telegram group are displayed along with the reply in the whatsapp group.

e.g in the telegram group a reply looks like this: [whatsapp] K3nny: [reply]: My reply is no.

a reply sent from telegram is displayed in the whatsapp group like this: [telegram] relayBotPhone: my reply is yes (re @mybridgebot: [whatsapp] K3nny: My reply is no.)

To Reproduce Steps to reproduce the behavior: set up a bridge with telegram and whatsapp and reply to a message in whatsapp. then view the bridged message in the telegram group

Expected behavior the message in the linked telegram group should contain the quoted message as is done in whatsapp

Screenshots/debug logs If applicable, add screenshots to help explain your problem. Use logs from running matterbridge -debug if possible.

Environment (please complete the following information):

Additional context

Config File:

[telegram.mytelegram]
Token="xxxxx"
RemoteNickFormat="[{PROTOCOL}] {NICK}: "
MessageFormat="HTMLNick"
QuoteDisable=false
QuoteFormat="{MESSAGE} (re @{QUOTENICK}: {QUOTEMESSAGE})"

[whatsapp.mywhatsapp]
Number="+xxxxx"

SessionFile="xxxx"

QrOnWhiteTerminal=false

RemoteNickFormat="[{PROTOCOL}] {NICK}: "

# / 
# GATEWAYS
# / 
[[gateway]]
name="Crew"
enable=true

    [[gateway.inout]]
    account="telegram.mytelegram"
    channel="-xxxx"

    [[gateway.inout]]
    account="whatsapp.mywhatsapp"

   channel="xxxx@g.us" 
ilmaisin commented 1 year ago

The PR that added the reply preservation feature to Whatsapp was this: https://github.com/42wim/matterbridge/pull/1974

I am not sure if I recall it right, but you might need to put PreserveThreading=true to the configuration sections of both bridges. It uses the native reply functionality of the messaging platforms. The "quote" feature of the Telegram bridge is different, and not present in any other bridge.

$SOMEONE might want to update the documentation.

K3nn3th2 commented 1 year ago

actually that works. but only when i enter the information in the config file WHILE matterbridge is running. after a restart, i need to change the file and re-save it in order for the reply functionality to work properly.

i wrote a small bat script for this in case anyone is interested:

start matterbridge.exe -conf matterbridge.toml TIMEOUT /T 20 echo. >> matterbridge.toml

(edit: the code tag put it all in one line.. therefor i give it to you without) probably material for a seperate issue?

The PR that added the reply preservation feature to Whatsapp was this: #1974

I am not sure if I recall it right, but you might need to put PreserveThreading=true to the configuration sections of both bridges. It uses the native reply functionality of the messaging platforms. The "quote" feature of the Telegram bridge is different, and not present in any other bridge.

$SOMEONE might want to update the documentation.