summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim <wim@42.be>2019-04-19 23:31:45 +0200
committerWim <wim@42.be>2019-04-23 23:28:13 +0200
commit0b03076a9dd411e567a06f231302f65d95e78c41 (patch)
tree1ac6b4900f24aec89b5d9caef279ea85d4e091b3
parent1e6a2bc8f7637234afe23e472383d36e54551e7e (diff)
downloadmatterbridge-msglm-0b03076a9dd411e567a06f231302f65d95e78c41.tar.gz
matterbridge-msglm-0b03076a9dd411e567a06f231302f65d95e78c41.tar.bz2
matterbridge-msglm-0b03076a9dd411e567a06f231302f65d95e78c41.zip
Handle unthreaded messages (mattermost). Fixes #803
-rw-r--r--bridge/mattermost/mattermost.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go
index ce4f4c33..e41b19d7 100644
--- a/bridge/mattermost/mattermost.go
+++ b/bridge/mattermost/mattermost.go
@@ -121,6 +121,12 @@ func (b *Bmattermost) Send(msg config.Message) (string, error) {
return msg.ID, b.mc.DeleteMessage(msg.ID)
}
+ // Handle prefix hint for unthreaded messages.
+ if msg.ParentID == "msg-parent-not-found" {
+ msg.ParentID = ""
+ msg.Text = fmt.Sprintf("[thread]: %s", msg.Text)
+ }
+
// Upload a file if it exists
if msg.Extra != nil {
for _, rmsg := range helper.HandleExtra(&msg, b.General) {