Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit 40cff5eaa3401c232578445a36a041db418be7ff Author: Wim <wim@42.be> Date: Mon Apr 04 00:19:31 2022 +0000 Change discord non-native threading behaviour (discord) (#1791) Sorta regression introduced by 5bae8f760ba3e9598e10724aba6d099e6ad2e174 which changes the way we get replies of matrix. This causes issues like https://github.com/42wim/matterbridge/issues/1780 We "fix" this by mimicking the old behaviour when "PreserveThreading" is disabled. diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index 1c2e8ca..cd3db76 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -2727 +2728 @@ func (b *Bdiscord) Send(msg config.Message) (string, error) {   // Handle prefix hint for unthreaded messages.   if msg.ParentNotFound() {   msg.ParentID = "" - msg.Text = fmt.Sprintf("[thread]: %s", msg.Text) + msg.Text = strings.TrimPrefix(msg.Text, "\n") + msg.Text = fmt.Sprintf("> %s %s", msg.Username, msg.Text)   }     // Use webhook to send the message