-
Notifications
You must be signed in to change notification settings - Fork 617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add initial Microsoft Teams support #967
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 229495 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 229587 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 229589 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 229621 lines exceeds the maximum allowed for the inline comments feature.
} | ||
|
||
func (b *Bmsteams) Disconnect() error { | ||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any cleanup to be done in the Disconnect
method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, no clean-ups needed (no state)
} | ||
|
||
func (b *Bmsteams) convertToMD(text string) string { | ||
if !strings.Contains(text, "<div>") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does html-generated MSTeams formatting always have a div
tag in the text?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to my tests, yes
Hi @42wim, excellent work! I've pulled this branch down and followed the setup instructions here. The instructions are clear and thorough. During setup, I had to change the following line to include the scopes that are listed in the comment: matterbridge/bridge/msteams/msteams.go Line 22 in a0596ab
Otherwise I got this error:
After applying this change and setting up the connection, I've confirmed pushing messages from Mattermost to MSTeams works properly, and messages posted in MSTeams are being delivered to Mattermost. I've verified that all of the points in the "working" section of the PR description are working properly. FindingsHere are some findings from usage. I assume some of these are an artifact of Microsoft's API support: Create a code block in MSTeams, and select a language for the code block. Matterbridge crashes when processing the message: panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x124fc03]
goroutine 12 [running]:
github.com/42wim/matterbridge/bridge/msteams.(*Bmsteams).handleAttachments(0xc000346d50, 0xc0005639e0, 0x0, 0xc00025f890, 0x0, 0xc0003d8ba0, 0xc00025f8a0, 0xc00025f8b0, 0xc0003d8b80, 0x0, ...)
/home/koch/go/src/github.com/mattermost/mattermost-matterbridge/bridge/msteams/handler.go:54 +0x143
github.com/42wim/matterbridge/bridge/msteams.(*Bmsteams).poll(0xc000346d50, 0xc0000d7380, 0x30)
/home/koch/go/src/github.com/mattermost/mattermost-matterbridge/bridge/msteams/msteams.go:175 +0x79c
created by github.com/42wim/matterbridge/bridge/msteams.(*Bmsteams).JoinChannel
/home/koch/go/src/github.com/mattermost/mattermost-matterbridge/bridge/msteams/msteams.go:75 +0x53
exit status 2 With MSTeams -> Mattermost: strikethrough and underline formatting is not rendered in Mattermost Markdown in general seems to not work with |
Thanks for testing, I'll look into the remaining issues! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 229663 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 229662 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 229663 lines exceeds the maximum allowed for the inline comments feature.
Code Climate has analyzed commit ff0b926 and detected 2 issues on this pull request. Here's the issue category breakdown:
Too many changed lines in diff View more on Code Climate. |
Hello!, I'm testing integration between Telegram/WhatsApp & MS Teams but only see messages being delivered to Teams, but no messagess deliverred to Telegram/WhatsApp. No errores in the logs, tested with 1.22.1 |
This implements Microsoft Teams support.
It uses polling to check for new messages because the ChatMessagesDelta isn't working (https://github.com/microsoftgraph/microsoft-graph-docs-contrib/issues/6235)
Documentation on how to setup can be found on https://github.com/42wim/matterbridge/wiki/MS-Teams-setup
working
not possible because Microsoft API limitations
The non-supported API issues are sending stuff to msteams, receiving stuff from msteams mostly works. Doesn't work: