Commit Graph

94 Commits

Author SHA1 Message Date
Duco van Amstel ce21ba1545 Fix golint linter issues and enable it in CI (#593) 2018-11-15 20:43:43 +01:00
Duco van Amstel 85564a35fd Fix IRC line splitting. Closes #584 (#587) 2018-11-14 22:43:52 +01:00
Duco van Amstel 16d5aeac7c Make config.Config more unit-test friendly (#586) 2018-11-13 23:30:56 +01:00
Duco van Amstel e19ba5a06a Add new Slack connection and forked legacy Slack bridge (#582) 2018-11-13 20:51:19 +01:00
Patrick Connolly 3d281b3316 Add ability to show when user is typing across Slack bridges (#559) 2018-11-08 20:45:40 +01:00
Patrick Connolly f2703979a4 Clean up config loading. (#561) 2018-11-07 22:32:12 +01:00
Patrick Connolly a20b7895a9 Preserve threading between Slack instances (#529)
* Opportunistically preserve Slack threading when parent thread in cache. [#529]

* Removed slack-specific processing from gateway.

* Added docs.

* Add option to enable threading, with default to off.

* Did cleanup on @42wim's comments.

* Update gateway/gateway.go

Co-Authored-By: patcon <patrick.c.connolly@gmail.com>

* Suggestion from @42wim :)

* Suggestions from @42wim.

* More suggestions.
2018-11-07 09:14:31 +01:00
Patrick Connolly 7e62bc4819 Remove hyphens when auto-loading envvars from viper config (#545)
* When auto-loading envvars from toml keys, remove hyphens.

See: https://unix.stackexchange.com/questions/23659/can-shell-variable-include-character
2018-11-03 14:42:27 +01:00
NikkyAI d058be25ad Respond with message on connect (api) (#550)
fix #549
2018-11-02 16:35:13 +01:00
Wim 7f3cbcedc0 Use own forks for logrus-prefixed-formatter and discordgo 2018-08-06 21:11:13 +02:00
Bruno Bierbaumer 6628a47f23 Add channel password support for XMPP (#451) 2018-06-18 22:55:45 +02:00
Wim bd9ea7a88d Add MediaDownloadBlacklist option. Closes #442 2018-06-09 14:35:02 +02:00
Remi Reuvekamp 33bd60528b Add config option MediaDownloadPath (#443)
* Add config option MediaUploadPath

MediaDownloadPath can be used instead of MediaServerUpload, for when your
webserver is on the same system as matterbridge and matterbridge has
write access to the serve dir.

* Limit length of hash in MediaServer urls to 8chars

Full SHA256 is unnecessary for uniqueness.
Also; if a file has the same first 8 charachters of the SHA256 hash,
it's still not a problem, as long as the filename is not the same.
2018-06-08 22:30:35 +02:00
Yuval Langer f0738a93c3 [WIP] Colorize username sent to IRC using its crc32 IEEE checksum (#423)
* Colorize username sent to IRC using its crc32 IEEE checksum

* Add `ColorNicks` configuration variable

* Add `ColorNicks` setting
2018-05-11 23:02:43 +02:00
Wim 406a54b597 Add QuoteFormat option (telegram). Closes #413 2018-05-11 20:59:15 +02:00
Wim 45296100df Add initial zulip support 2018-05-07 21:35:48 +02:00
Wim 96a47a60ad Add support for reloading all settings automatically after changing config except connection and gateway configuration. Closes #373 2018-05-01 22:23:37 +02:00
Wim b69fc30902 Fix regression in ReplaceMessages and ReplaceNicks. Closes #407 2018-04-21 23:26:39 +02:00
Wim e57f3a7e6c Add QuoteDisable option (telegram). Closes #399 2018-04-17 23:26:41 +02:00
Wim e5989adf92 Add support for NoSendJoinPart. Closes #382 2018-03-06 21:35:47 +01:00
Wim 98027446c8 Fix tests and make megacheck happy 2018-03-05 00:30:46 +01:00
Wim f2f1d874e1 Use viper (github.com/spf13/viper) for configuration 2018-03-04 23:52:14 +01:00
Wim 2110db6f0c Add environment override back 2018-02-27 23:22:12 +01:00
Wim 2bac867382 Refactor using factory 2018-02-27 23:22:12 +01:00
Wim f8714d81f5 Add DebugLevel option (irc) 2018-02-22 18:56:21 +01:00
Wim e622587db4 Add label support in RemoteNickFormat 2018-02-20 18:57:46 +01:00
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.
2018-02-20 01:15:25 +01:00
Wim f58be0d1c1 Add SHA to FileInfo 2018-02-15 23:18:58 +01:00
Wim 2522158127 Add avator to fileinfo 2018-02-14 22:20:27 +01:00
Wim 80822b7fff Send chat notification if media is too big to be re-uploaded to MediaServer. See #359 2018-02-03 01:11:11 +01:00
Wim 67f6257617 Add ShowTopicChange option. Allow/disable topic change messages (currently only from slack). Closes #353 2018-02-02 21:08:13 +01:00
Wim 6a047f8722 Print only debug messages when specified (xmpp). Closes #345 2018-01-26 21:54:09 +01:00
Wim 97c944bb63 Add RejoinDelay option. Delay to rejoin after channel kick (irc). Closes #322 2017-12-23 00:11:30 +01:00
Wim d0c4fe78ee Allow specifying maximum download size of media using MediaDownloadSize (slack,telegram,matrix) 2017-12-19 23:44:13 +01:00
Wim 265457b451 Refactor and add MediaDownloadSize to General 2017-12-19 23:15:03 +01:00
Wim 67a9d133e9 Add quick & dirty sshchat support (https://github.com/shazow/ssh-chat) 2017-12-03 01:29:25 +01:00
Wim e0cbb69a4f Add MessageSplit option to split messages on MessageLength (irc). Closes #281 2017-11-24 23:29:00 +01:00
Wim 1efe40add5 Add initial support for an external mediaserver. #278
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
2017-11-24 22:36:19 +01:00
Wim cd4c9b194f Add support for ReplaceNicks using regexp to replace nicks. Closes #269 2017-11-20 23:27:27 +01:00
Wim aff3964078 Add support for ReplaceMessages using regexp to replace messages. #269 2017-11-15 23:33:00 +01:00
Wim 36a800c3f5 Add support for comments from slack file uploads (slack) 2017-11-13 00:20:31 +01:00
Wim 41aa8ad799 Add StripNick option, only allow alphanumerical nicks. Closes #285 2017-10-27 00:07:33 +02:00
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).
2017-09-21 22:35:21 +02:00
Wim b49fb2b69c Add support for Quakenet auth (irc). Closes #263 2017-09-20 22:47:26 +02:00
Wim 1a40b0c1e9 Relay attachments from mattermost to slack (slack). Closes #260 2017-09-18 23:51:27 +02:00
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)
2017-09-11 22:45:15 +02:00
Wim e7fcb25107 Add a charset option (irc). Closes #247 2017-08-29 21:31:03 +02:00
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.
2017-08-28 00:33:17 +02:00
Wim 28710d0bc7 Allow a webhookurl per channel (discord). #239 2017-08-12 14:51:41 +02:00
anon724 67905089ba Add UseUserName option (discord) (#234) 2017-08-01 18:18:55 +02:00