Teams receives message from Mattermost but Mattermost doesn't receive the message from Teams #1733
Replies: 4 comments
-
I've seen the same behavior for Matrix/Teams. No replies in Teams threads are transferred to matrix only first post of a thread. No information in debug log. I gave up on Teams for now. |
Beta Was this translation helpful? Give feedback.
-
Any follow-up on this? Am looking into bridging Teams. |
Beta Was this translation helpful? Give feedback.
-
This is a year late, but I think I figured out the main issue here. If you recall, at the end of setting up the bridge, you were presented with a URL and code to authenticate the Teams end of the bridge. When you authenticated, you logged in using an account that had access to the channel the bridge was supposed to join. The part that wiki does not mention is that the bridge posts in that channel as the authenticated user. In order to prevent echoing back relayed messages, the bridge ignores any messages posted by the authenticated user, and the only hint of this is in the debug logs as the line "[poll:bridge/msteams/msteams.go:178] skipping own message". Example: The offending code is if *msg.From.User.ID == b.botID {
b.Log.Debug("skipping own message")
msgmap[*msg.ID] = *msg.CreatedDateTime
continue
} so the only way I see to resolve this, without changing the code, is to have a dedicated bot user. I do not know enough about Teams and Azure applications to know if the application could spoof a User ID different from the one used to authenticate the bridge. |
Beta Was this translation helpful? Give feedback.
-
As for what @mahdi1234 said about the bridge only relaying the first post of threads, but not the replies, I'm not entirely sure on that one. I assume the bridge just isn't listening for the right events since the reoccuing action seems to be the bridge calling this function func (b *Bmsteams) getMessages(channel string) ([]msgraph.ChatMessage, error) {
ct := b.gc.Teams().ID(b.GetString("TeamID")).Channels().ID(channel).Messages().Request()
rct, err := ct.Get(b.ctx)
if err != nil {
return nil, err
}
b.Log.Debugf("got %#v messages", len(rct))
return rct, nil
} It might need to loop through each message to get replies, but that would be inefficient, especially for larger Teams channels with lots of messages with replies. |
Beta Was this translation helpful? Give feedback.
-
Hi,
We've setup the Teams/Mattermost configuration as per the instructions and the messages added into the channel in Mattermost are appearing in teams. However, the messages added to the channel in teams are not appearing in the Mattermost channel.
Does anyone know what would cause this behaviour?
Beta Was this translation helpful? Give feedback.
All reactions