summaryrefslogtreecommitdiffstats
path: root/gateway/router.go
Commit message (Collapse)AuthorAgeFilesLines
* Add ability to procure avatars from the destination bridge (#1000)Qais Patankar2020-02-091-0/+3
| | | | | | | | | | | | * remote_avatar: add UseLocalAvatar * remote_avatar: make sure msg.Protocol is always set correctly * remote_avatars: support msg.Account * remote_avatar: add to matterbridge.toml.sample * remote_avatar: clarify something
* Do configuration validation on start-up. Fixes #888 (#889)Wim2019-09-091-0/+6
| | | | | | Fail if: * we don't have any gateways configured * we have gateways configured but with non-existing bridge configuration * we have gateways configured without any configuration
* Support webhook message deletions (discord) (#853)Qais Patankar2019-07-081-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Support webhook message deletions (discord) Messages sent via webhook can now be deleted. It seems it can do this without any special permissions. This copies discordgo.WebhookExecute and makes it support the returning of discordgo.Message. A pull request has been sent upstream, so we should use that if @bwmariin accepts the pull request: https://github.com/bwmarrin/discordgo/pull/663 Changes in behaviour (webhook mode only): - Previously messages *edited* on other platforms would just be retransmitted as a brand new message to Discord. - Message *edits* will now be ignored. - Debug: message edits will now print out a "permission error". In the future it may be good to send an "message edited" react to those webhook messages, so at least people know that the message was edited on other platforms. (Even though it can't actually show the new message.) Alternatively, message edits could just send a brand new message with a link back to the old one. This is a little ugly but it would ensure that Discord users are able to see the edited message. These "message edit notifications" would be sent from the bot user (not from a webhook), so we could edit the "edit notification" if subsequent edits to the original message are made.
* Handle file upload/download only once for each message (#742)Wim2019-02-271-1/+5
|
* Make all loggers derive from non-default instance (#728)Wim2019-02-231-14/+25
|
* Disable updateChannelMembers for nowWim2019-02-211-1/+1
|
* Send GetChannelMembers event only to slack for nowWim2019-01-241-0/+4
|
* Add initial support for getting ChannelMember info of all bridges (#678)Wim2019-01-181-0/+22
| | | | | | | | | | | | | | * Add initial support for getting ChannelMember info of all bridges. Adds an EventGetChannelMembers event, which gets send every x time to all bridges. Bridges should respond on this event with a Message containing ChannelMembers in the EventGetChannelMembers key in the Extra field. handleEventGetChannelMembers will handle this Message and sets the contained ChannelMembers to the Bridge struct. * Add ChannelMembers support to the slack bridge
* Refactor gateway (#648)Wim2018-12-121-32/+14
| | | | | | | * Decrease complexity of handleMessage, handleReceive, handleFiles * Move handlers to handlers.go * Split ignoreMessage up in ignoreTextEmpty, ignoreNicks and IgnoreTexts * Add ignoreEvent * Add testcase for ignoreTextEmpty, ignoreNicks, ignoreTexts and ignoreEvent
* Extract bridgeMap into own package to improve testability (#601)Patrick Connolly2018-11-301-1/+3
|
* Add option to ignore failing bridge on start. Fixes #455 (#603)Wim2018-11-251-2/+31
|
* Add protocol to msg.ID in cache (#596)Wim2018-11-191-2/+2
|
* Fix golint linter issues and enable it in CI (#593)Duco van Amstel2018-11-151-3/+3
|
* Make config.Config more unit-test friendly (#586)Duco van Amstel2018-11-131-6/+11
|
* Add support for mattermost matterbridge pluginWim2018-11-111-3/+4
|
* Make scopelint happyWim2018-11-081-0/+1
|
* Reconnect on quit. (irc) See #431 (#445)Liam Stanley2018-06-091-1/+2
| | | | | * potential fixes for #431 * go: fix formatting/gofmt/goreturns
* Do some small cleanupsWim2018-02-271-5/+1
|
* Use prefixed-formatter for better loggingWim2018-02-211-3/+3
|
* Move Sirupsen => sirupsenWim2018-02-201-1/+2
|
* Add initial support for an external mediaserver. #278Wim2017-11-241-0/+1
| | | | | | | | Add 2 extra options `MediaServerUpload` and `MediaServerDownload`, where the URL for upload and download can be specified. See https://github.com/42wim/matterbridge/wiki/Mediaserver-setup-%5Badvanced%5D for an example with caddy
* Do not add messages without ID to cacheWim2017-08-291-1/+1
|
* Add support for editing messages across bridges. Currently mattermost/discord.Wim2017-08-281-1/+7
| | | | | | | | | | | | | | | | | | | | | | 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.
* Remove unused functionWim2017-07-301-10/+0
|
* Handle same account in multiple gateways betterWim2017-07-301-10/+9
|
* Refactor. Add testsWim2017-07-251-0/+117