summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim <wim@42.be>2019-02-16 18:36:09 +0100
committerGitHub <noreply@github.com>2019-02-16 18:36:09 +0100
commit99d71c21770cc371d38c71995dccfdd9489be7c4 (patch)
treedd96fee75c1322598d8b69cb22125a0ef551d4c3
parent3e60cfafd342b0a6d27947d27cc125421b8f028a (diff)
downloadmatterbridge-msglm-99d71c21770cc371d38c71995dccfdd9489be7c4.tar.gz
matterbridge-msglm-99d71c21770cc371d38c71995dccfdd9489be7c4.tar.bz2
matterbridge-msglm-99d71c21770cc371d38c71995dccfdd9489be7c4.zip
Send notices on join/parts (matrix). Fixes #712 (#716)
-rw-r--r--bridge/matrix/matrix.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/bridge/matrix/matrix.go b/bridge/matrix/matrix.go
index 708788a9..e26cf238 100644
--- a/bridge/matrix/matrix.go
+++ b/bridge/matrix/matrix.go
@@ -113,6 +113,15 @@ 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 {