diff options
author | Wim <wim@42.be> | 2020-05-24 15:49:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-24 15:49:24 +0200 |
commit | 7f7ca697a0a48f0e82cb0309ee1dfcd15ba60cd7 (patch) | |
tree | 62c9e1952bdf1bd64adad5ee2bf33908b792c8ac /bridge | |
parent | 900375679bfa248bcf02c203e9265e5e93a17a73 (diff) | |
download | matterbridge-msglm-7f7ca697a0a48f0e82cb0309ee1dfcd15ba60cd7.tar.gz matterbridge-msglm-7f7ca697a0a48f0e82cb0309ee1dfcd15ba60cd7.tar.bz2 matterbridge-msglm-7f7ca697a0a48f0e82cb0309ee1dfcd15ba60cd7.zip |
Ignore non-user messages (msteams). Fixes #1141 (#1149)
Ignore these messages for now, also add a extra
debug option for msteams so we can dump the whole
message.
Diffstat (limited to 'bridge')
-rw-r--r-- | bridge/msteams/msteams.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bridge/msteams/msteams.go b/bridge/msteams/msteams.go index be0cd88f..4d4acc2a 100644 --- a/bridge/msteams/msteams.go +++ b/bridge/msteams/msteams.go @@ -10,6 +10,7 @@ import ( "github.com/42wim/matterbridge/bridge" "github.com/42wim/matterbridge/bridge/config" + "github.com/davecgh/go-spew/spew" "github.com/mattn/godown" msgraph "github.com/yaegashi/msgraph.go/beta" @@ -158,11 +159,22 @@ func (b *Bmsteams) poll(channelName string) error { continue } } + + if b.GetBool("debug") { + b.Log.Debug("Msg dump: ", spew.Sdump(msg)) + } + + // skip non-user message for now. + if msg.From.User == nil { + continue + } + if *msg.From.User.ID == b.botID { b.Log.Debug("skipping own message") msgmap[*msg.ID] = *msg.CreatedDateTime continue } + msgmap[*msg.ID] = *msg.CreatedDateTime if msg.LastModifiedDateTime != nil { msgmap[*msg.ID] = *msg.LastModifiedDateTime |