Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit 70ad4d2eaf752499025482b27872ec7c285fc903 Author: Wim <wim@42.be> Date: Sat Feb 16 18:36:09 2019 +0000 Send notices on join/parts (matrix). Fixes #712 (#716) diff --git a/bridge/matrix/matrix.go b/bridge/matrix/matrix.go index 708788a..e26cf23 100644 --- a/bridge/matrix/matrix.go +++ b/bridge/matrix/matrix.go @@ -1136 +11315 @@ func (b *Bmatrix) Send(msg config.Message) (string, error) {   // Edit message if we have an ID   // matrix has no editing support   + // Use notices to send join/leave events + if msg.Event == config.EventJoinLeave { + resp, err := b.mc.SendNotice(channel, msg.Username+msg.Text) + if err != nil { + return "", err + } + return resp.EventID, err + } +   // Post normal message with HTML support (eg riot.im)   resp, err := b.mc.SendHTML(channel, msg.Username+msg.Text, html.EscapeString(msg.Username)+helper.ParseMarkdown(msg.Text))   if err != nil {