summaryrefslogtreecommitdiffstats
path: root/bridge/msteams/msteams.go
diff options
context:
space:
mode:
authorQais Patankar <qaisjp@gmail.com>2020-12-31 18:01:57 +0000
committerGitHub <noreply@github.com>2020-12-31 18:01:57 +0000
commita9d8ac8bc0c745d43440aa56f1b602edf8e4aef7 (patch)
treee6ce1698337ae6882470028fe659f690f384efe9 /bridge/msteams/msteams.go
parent1a4717b366a2371dacc0ce205b0a42c5b31f52dc (diff)
downloadmatterbridge-msglm-a9d8ac8bc0c745d43440aa56f1b602edf8e4aef7.tar.gz
matterbridge-msglm-a9d8ac8bc0c745d43440aa56f1b602edf8e4aef7.tar.bz2
matterbridge-msglm-a9d8ac8bc0c745d43440aa56f1b602edf8e4aef7.zip
Refactor "msg-parent-not-found" to config.ParentIDNotFound (#1347)
Diffstat (limited to 'bridge/msteams/msteams.go')
-rw-r--r--bridge/msteams/msteams.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/bridge/msteams/msteams.go b/bridge/msteams/msteams.go
index 4d4acc2a..87a15a7a 100644
--- a/bridge/msteams/msteams.go
+++ b/bridge/msteams/msteams.go
@@ -86,13 +86,16 @@ func (b *Bmsteams) JoinChannel(channel config.ChannelInfo) error {
func (b *Bmsteams) Send(msg config.Message) (string, error) {
b.Log.Debugf("=> Receiving %#v", msg)
- if msg.ParentID != "" && msg.ParentID != "msg-parent-not-found" {
+ if msg.ParentValid() {
return b.sendReply(msg)
}
- if msg.ParentID == "msg-parent-not-found" {
+
+ // Handle prefix hint for unthreaded messages.
+ if msg.ParentNotFound() {
msg.ParentID = ""
msg.Text = fmt.Sprintf("[thread]: %s", msg.Text)
}
+
ct := b.gc.Teams().ID(b.GetString("TeamID")).Channels().ID(msg.Channel).Messages().Request()
text := msg.Username + msg.Text
content := &msgraph.ItemBody{Content: &text}