summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim <wim@42.be>2022-04-04 00:19:31 +0200
committerGitHub <noreply@github.com>2022-04-04 00:19:31 +0200
commitce782ff6fb1109811bfefa8d7c329af34517fab5 (patch)
tree1345ce75666bf0c18b451873c16cca5fe07dfa47
parentc6716e030c02f316b887c1d3ee4b443aa3ab6afd (diff)
downloadmatterbridge-msglm-ce782ff6fb1109811bfefa8d7c329af34517fab5.tar.gz
matterbridge-msglm-ce782ff6fb1109811bfefa8d7c329af34517fab5.tar.bz2
matterbridge-msglm-ce782ff6fb1109811bfefa8d7c329af34517fab5.zip
Change discord non-native threading behaviour (discord) (#1791)
Sorta regression introduced by 9a8ce9b17e560433731eb5efa3cee7ced0b93605 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.
-rw-r--r--bridge/discord/discord.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go
index 1c2e8ca4..cd3db76d 100644
--- a/bridge/discord/discord.go
+++ b/bridge/discord/discord.go
@@ -272,7 +272,8 @@ 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