From ed018207226912ee57ecaae06c539aea37e7bb96 Mon Sep 17 00:00:00 2001 From: Wim Date: Mon, 11 Sep 2017 22:45:15 +0200 Subject: Add support for deleting messages across bridges. Currently fully support mattermost,slack and discord. Message deleted on the bridge or received from other bridges will be deleted. Partially support for Gitter. Gitter bridge will delete messages received from other bridges. But if you delete a message on gitter, this deletion will not be sent to other bridges (this is a gitter API limitation, it doesn't propogate edits or deletes via the API) --- bridge/gitter/gitter.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'bridge/gitter') diff --git a/bridge/gitter/gitter.go b/bridge/gitter/gitter.go index 9a7b3bf9..b1d68733 100644 --- a/bridge/gitter/gitter.go +++ b/bridge/gitter/gitter.go @@ -106,6 +106,17 @@ func (b *Bgitter) Send(msg config.Message) (string, error) { flog.Errorf("Could not find roomID for %v", msg.Channel) return "", nil } + if msg.Event == config.EVENT_MSG_DELETE { + if msg.ID == "" { + return "", nil + } + // gitter has no delete message api + _, err := b.c.UpdateMessage(roomID, msg.ID, "") + if err != nil { + return "", err + } + return "", nil + } if msg.ID != "" { flog.Debugf("updating message with id %s", msg.ID) _, err := b.c.UpdateMessage(roomID, msg.ID, msg.Username+msg.Text) -- cgit v1.2.3