diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index 51dbe6bc71..8c2c4a3ec9 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -337,7 +337,7 @@ func (b *Bdiscord) handleEventBotUser(msg *config.Message, channelID string) (st } m := discordgo.MessageSend{ - Content: msg.Username + msg.Text, + Content: msg.Username + ": " + msg.Text, AllowedMentions: b.getAllowedMentions(), } diff --git a/bridge/status/status.go b/bridge/status/status.go index a39dcc5bd6..6c6b1e4f18 100644 --- a/bridge/status/status.go +++ b/bridge/status/status.go @@ -219,6 +219,7 @@ func (b *Bstatus) propagateMessage(msg *common.Message) { Text: msg.Text, Channel: msg.ChatId, ID: msg.ID, + ParentID: msg.ResponseTo, Account: b.Account, } } @@ -245,6 +246,10 @@ func (b *Bstatus) toStatusMsg(msg config.Message) *common.Message { } } + if msg.ParentID != "" { + originalParentID = msg.ParentID + } + message.Payload = &protobuf.ChatMessage_BridgeMessage{ BridgeMessage: &protobuf.BridgeMessage{ BridgeName: msg.Protocol, @@ -297,6 +302,8 @@ func (b *Bstatus) Send(msg config.Message) (string, error) { return "", errors.Wrap(err, "failed to get status message for bridge message") } + sentMessageID := "" + if statusMessageID != "" { decodedStatusMessageID, err := types.DecodeHex(statusMessageID) if err != nil { @@ -307,18 +314,20 @@ func (b *Bstatus) Send(msg config.Message) (string, error) { Text: msg.Text, ContentType: protobuf.ChatMessage_BRIDGE_MESSAGE, } - _, err = b.messenger.EditMessage(context.Background(), editedMessage) + response, err := b.messenger.EditMessage(context.Background(), editedMessage) if err != nil { return "", errors.Wrap(err, "failed to edit message") } + sentMessageID = response.Messages()[0].ID } else { - _, err := b.messenger.SendChatMessage(context.Background(), statusMessageToSend) + response, err := b.messenger.SendChatMessage(context.Background(), statusMessageToSend) if err != nil { return "", errors.Wrap(err, "failed to send message") } + sentMessageID = response.Messages()[0].ID } - return "", nil + return sentMessageID, nil } func (b *Bstatus) Connect() error { diff --git a/status.toml b/status.toml index fadbaa3cfd..26b4b1df14 100644 --- a/status.toml +++ b/status.toml @@ -12,6 +12,7 @@ RemoteNickFormat="{NICK}" DataDir="path to status data dir" NodeConfigFile="path to json with node config and fleets" + PreserveThreading=true [discord] [discord.mydiscord] @@ -19,6 +20,7 @@ Server="" AutoWebhooks=true RemoteNickFormat="{NICK}" + PreserveThreading=true [[gateway]] name="gateway3"