Commit Graph

83 Commits (c585d00f162cc244b381fcaaef7ac5b1efda2cf5)

Author SHA1 Message Date
Wim f94c2b40a3
Refactor mattermost bridge (#622)
* Split up in different files
* Decrease complexity
* Fix linting issues
6 years ago
Duco van Amstel 09875fe160 Update direct dependencies where possible 6 years ago
Duco van Amstel ce21ba1545 Fix golint linter issues and enable it in CI (#593) 6 years ago
Wim f7a5077d5d Fix goconst linter failure 6 years ago
Wim d2ae3ebf9e Disable Connect(), JoinChannel(), Send() for mattermost.plugin 6 years ago
Wim 78401214b0 Make scopelint happy 6 years ago
Wim b2a07aba3a Make goconst linter happy 6 years ago
Wim 1e0bb3da95 Make gocritic linter happier 6 years ago
Wim e2b50d6194 Add better support for multiperson DM (mattermost) 6 years ago
Wim 107969c09a
Split up cookie token and personal token (mattermost). Fixes #530 (#540) 6 years ago
Wim 330ddb6a30 Fix panic by using matterclient calls in the right place. Related to cb7278eb (mattermost). Closes #491 6 years ago
Wim fa0c4025f7 Fix avatar uploads to work with MediaDownloadPath. Closes #454 6 years ago
Wim cb7278eb50 Use nickname instead of username if defined (mattermost). Closes #452 6 years ago
Wim d2c02be3a0 Handle slack attachments sent to mattermost. Closes #447 6 years ago
Liam Stanley 51327a4056 Reconnect on quit. (irc) See #431 (#445)
* potential fixes for #431
* go: fix formatting/gofmt/goreturns
6 years ago
Wim 07885f5810 Fix iconurl regression (mattermost,slack,rocketchat). Closes #430 6 years ago
Wim 411ef2691c Use uuid instead of userid. Fixes #429 6 years ago
Wim 68fbed9281 Make our callbackid more unique. Fixes issue with running multiple matterbridge on the same channel (slack,mattermost) 6 years ago
Wim e5989adf92 Add support for NoSendJoinPart. Closes #382 6 years ago
Wim 80fcf18e24 Remove debug messsage (mattermost) 6 years ago
Wim f2f1d874e1 Use viper (github.com/spf13/viper) for configuration 6 years ago
Wim 594d2155e3 Improve debug messages 6 years ago
Wim 2bac867382 Refactor using factory 6 years ago
Wim 73525a4bbc Make gometalinter happier 6 years ago
Wim d62f49d1fc Skip events for webhook 6 years ago
Wim bd2a672c14 Refactor mattermost 6 years ago
Wim 67d2398fa8 Make matterclient work with prefixed log 6 years ago
Wim d1227b5fc9 Use prefixed-formatter for better logging 6 years ago
Wim 6ea368c383 Move Sirupsen => sirupsen 6 years ago
Wim 7886f05e88 Download (and upload) avatar images from mattermost and telegram when mediaserver is configured. Closes #362
An extra avatarMap (cache) is created for mattermost and telegram.
If MediaServerUpload is configured, the avatar images of users are downloaded the first time a
user sends a message.
If this download succeeds a message with EVENT_AVATAR_DOWNLOAD is sent to the originating protocol.
This message also contains a SHA field (in msg.Extra["file"]), if this is not empty, the sha will
be added to the avatarMap. (so we now have a userid-sha cache)

Next time this user sends a message, the MediaServerUpload/sha/userid.png URL will be used as the
avatar field.
6 years ago
Wim 80822b7fff Send chat notification if media is too big to be re-uploaded to MediaServer. See #359 7 years ago
Wim 169c614489 Download files and reupload to supported bridges (mattermost). Closes #357 7 years ago
Wim 64a20ee61b Add URL to message in webhook if available (mattermost). See #356 7 years ago
Wim 8e78b3e6be Fix regression in mattermost bridge (mattermost). Closes #327 7 years ago
Wim 265457b451 Refactor and add MediaDownloadSize to General 7 years ago
Wim 36a800c3f5 Add support for comments from slack file uploads (slack) 7 years ago
Wim 7aabe12acf Fix loop, make megacheck happy 7 years ago
Wim c4b75e5754 Download files from slack and reupload to mattermost (slack/mattermost). Closes #255
Refactor message.Extra to a map[string][]interface{} to have a bit more flexibility
for stuffing extra stuff.

For attached files from slack, files < 1MB size get downloaded (in memory), and get
put into Extra["file"][]config.FileInfo (containing a pointer to the buffer and
the filename). This is not async so slack channels with lots of attached files
may suffer a slowdown. (the download timeout is set at 5 seconds).
7 years ago
Wim 47b7fae61b Fix loop from webhook by adding matterbridge prop (mattermost). Closes #261 7 years ago
Wim 1a40b0c1e9 Relay attachments from mattermost to slack (slack). Closes #260 7 years ago
Wim 82588b00c5 Use override username if specified (mattermost). #260 7 years ago
Wim ed01820722 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)
7 years ago
Wim 9039720013 Send images when text is empty regression. (mattermost). Closes #254 7 years ago
Wim 9e03fcf162 Fix private channel joining bug (mattermost). Closes #248 7 years ago
Wim 7c773ebae0 Add support for editing messages across bridges. Currently mattermost/discord.
Our Message type has an extra ID field which contains the message ID of the specific bridge.
The Send() function has been modified to return a msg ID (after the message to that specific
bridge has been created).

There is a lru cache of 5000 entries (message IDs). All in memory, so editing messages
will only work for messages the bot has seen.

Currently we go out from the idea that every message ID is unique, so we don't keep
the ID separate for each bridge. (we do for each gateway though)

If there's a new message from a bridge, we put that message ID in the LRU cache as key
and the []*BrMsgID as value (this slice contains the message ID's of each bridge that
received the new message)

If there's a new message and this message ID already exists in the cache, it must be
an updated message. The value from the cache gets checked for each bridge and if there
is a message ID for this bridge, the ID will be added to the Message{} sent to that
bridge. If the bridge sees that the ID isn't empty, it'll know it has to update the
message with that specific ID instead of creating a new message.
7 years ago
Wim 5a8d7b5f6d Modify Send() to return also a message id 7 years ago
Wim 7f9a400776 Add support for personal access tokens (mattermost)
* https://docs.mattermost.com/developer/personal-access-tokens.html
7 years ago
Wim 28710d0bc7 Allow a webhookurl per channel (discord). #239 7 years ago
Wim f8e6a69d6e Add action support for slack,mattermost,irc,gitter,matrix,xmpp,discord. #199 7 years ago
Wim ba653c0841 Ignore edited messages with reactions (mattermost) 7 years ago