5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-10 06:20:28 +00:00
Commit Graph

124 Commits

Author SHA1 Message Date
Ben Wiederhake
b2af76e7dc
Support Telegram animated stickers (tgs) format (#1173)
This is half a fix for #874

This patch introduces a new config flag:
- MediaConvertTgs

These need to be treated independently from the existing
MediaConvertWebPToPNG flag because Tgs→WebP results in an
*animated* WebP, and the WebP→PNG converter can't handle
animated WebP files yet.

Furthermore, some platforms (like discord) don't even support
animated WebP files, so the user may want to fall back to
static PNGs (not APNGs).

The final reason why this is only half a fix is that this
introduces an external dependency, namely lottie, to be
installed like this:

$ pip3 install lottie cairosvg

This patch works by writing the tgs to a temporary file in /tmp,
calling lottie to convert it (this conversion may take several seconds!),
and then deleting the temporary file.
The temporary file is absolutely necessary, as lottie refuses to
work on non-seekable files.
If anyone comes up with a reasonable use case where /tmp is
unavailable, I can add yet another config option for that, if desired.

Telegram will bail out if the option is configured but lottie isn't found.
2020-08-23 22:34:28 +02:00
z3bra
213bf349c3
Add an option to log into a file rather than stdout (#1168)
Use Logfile option in the `[general]` section
2020-07-18 15:46:19 +02:00
Qais Patankar
a41accd033
Add sane RemoteNickFormat default for API (#1157) 2020-06-25 00:25:10 +02:00
Wim
ba0bfe70a8
Add StripMarkdown option (irc). (#1145)
Enable `StripMarkdown` to strip markdown for irc.
2020-05-23 21:46:15 +02:00
Wim
d44598a900
Add an option to disable sending HTML to matrix. Fixes #1022 (#1135) 2020-05-14 00:37:41 +02:00
Wim
9190365289
Add JoinDelay option (irc). Fixes #1084 (#1098) 2020-04-19 00:46:35 +02:00
Jakub
6b017b226a
Support JSON and YAML config formats (#1045)
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2020-03-18 23:20:29 +01:00
Wim
795a8705c3 Add initial Microsoft Teams support
Documentation on https://github.com/42wim/matterbridge/wiki/MS-Teams-setup
2020-03-01 22:19:33 +01:00
Qais Patankar
c91bfd08d8 Add ability to procure avatars from the destination bridge (#1000)
* 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
2020-02-09 22:07:26 +01:00
Wim
f8ad877601
Add DisableWebPagePreview option (telegram). Closes #980 (#994) 2020-02-02 18:53:04 +01:00
Humorhenker
fc30b1bacc
Add QuoteLengthLimit option (telegram) fixes #963 (#985)
* QuoteLengthLimit option added to limit max. quoted message length if QuoteLengthLimit = 0 the whole message will be quoted
2020-01-30 00:02:33 +01:00
Wim
28783a4146
Do configuration validation on start-up. Fixes #888 (#889)
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
2019-09-09 23:48:00 +02:00
cori hudson
921f2dfcdf Add initial Keybase Chat support (#877)
* initial work on native keybase bridging

* Hopefully make a functional keybase bridge

* add keybase to bridgemap

* send to right channel, try to figure out received msgs

* add account and userid

* i am a Dam Fool

* Fix formatting for messages, handle /me

* update vendors, ran golint and goimports

* move handlers to handlers.go, clean up unused config options

* add sample config, fix inconsistent remote nick handling

* Update readme with keybase links

* Resolve fixmie errors

* Error -> Errorf

* fix linting errors in go.mod and go.sum

* explicitly join channels, ignore messages from non-specified channels

* check that team names match before bridging message
2019-08-26 21:00:31 +02:00
Joona Hoikkala
80b4cec87a Add an option to skip the Mattermost server version check (#849)
Adds SkipVersionCheck bool option for mattermost
2019-06-16 16:23:50 +02:00
Wim
e610fb3201 Make config parse errors readable 2019-06-02 09:35:20 +01:00
Wim
2d277a15f5
Add scripting (tengo) support for every outgoing message (#806)
Adds a new key OutMessage under [tengo] table, which specifies the location of the script that
will be invoked on each message being sent to a bridge and can be used to modify the Username
and the Text of that message.

The script will have the following global variables:
read-only:
inAccount, inProtocol, inChannel, inGateway
outAccount, outProtocol, outChannel, outGateway

read-write:
msgText, msgUsername

The script is reloaded on every message, so you can modify the script on the fly.

The default script in https://github.com/42wim/matterbridge/tree/master/internal/tengo/outmessage.tengo
is compiled in and will be executed if no script is specified.
2019-04-19 18:27:31 +02:00
chotaire
6b47e29583 Add verbose IRC joins/parts (ident@host) (#805)
New configuration setting: VerboseJoinPart (default is false)
2019-04-18 23:56:05 +02:00
Wim
7a24de15e4
Add tengo support to RemoteNickFormat (#793)
This commit add support for using the result of a tengo script in RemoteNickFormat using {TENGO}
Also adds a new toml table [tengo] with key RemoteNickFormat and value location of the script.
This also moves the TengoModifyMessage from [general] to Message in [tengo]

Documentation:

RemoteNickFormat allows you to specify the location of a tengo (https://github.com/d5/tengo/) script.
The script will have the following global variables:
to modify: result
to read: channel, bridge, gateway, protocol, nick

The result will be set in {TENGO} in the RemoteNickFormat key of every bridge where {TENGO} is specified
The script is reloaded on every message, so you can modify the script on the fly.
Example script can be found in https://github.com/42wim/matterbridge/tree/master/contrib/remotenickformat.tengo

[tengo]
RemoteNickFormat="remotenickformat.tengo"
2019-04-08 20:58:21 +02:00
Wim
26a7e35f27
Add MediaConvertWebPToPNG option (telegram). (#741)
* Add MediaConvertWebPToPNG option (telegram).

When enabled matterbridge will convert .webp files to .png files
before uploading them to the mediaserver of the other bridges.

Fixes #398
2019-02-27 00:41:50 +01:00
Wim
bf21604d42
Make all loggers derive from non-default instance (#728) 2019-02-23 22:51:27 +01:00
Wim
1bb39eba87
Add scripting (tengo) support for every incoming message (#731)
TengoModifyMessage allows you to specify the location of a tengo (https://github.com/d5/tengo/) script.
This script will receive every incoming message and can be used to modify the Username and the Text of that message.
The script will have the following global variables:
to modify: msgUsername and msgText
to read: msgChannel and msgAccount

The script is reloaded on every message, so you can modify the script on the fly.

Example script can be found in https://github.com/42wim/matterbridge/tree/master/gateway/bench.tengo
and https://github.com/42wim/matterbridge/tree/master/contrib/example.tengo

The example below will check if the text contains blah and if so, it'll replace the text and the username of that message.
text := import("text")
if text.re_match("blah",msgText) {
    msgText="replaced by this"
    msgUsername="fakeuser"
}

More information about tengo on: https://github.com/d5/tengo/blob/master/docs/tutorial.md and
https://github.com/d5/tengo/blob/master/docs/stdlib.md
2019-02-23 16:39:44 +01:00
Declan Hoare
a7dd033c3b Allow sending discriminator with Discord username (#726) 2019-02-22 14:28:27 +01:00
Krzysiek Madejski
55e79063d6 Add initial WhatsApp support (#711) 2019-02-21 20:28:13 +01:00
Wim
a8fe54a78d
Allow zulip bridge to specify topic per channel. Closes #701 (#723) 2019-02-17 21:50:05 +01:00
Wim
fb713ed91b
Add initial support for getting ChannelMember info of all bridges (#678)
* 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
2019-01-18 18:35:31 +01:00
Wim
bab385c342 Remove unused key (config) 2019-01-04 16:37:45 +01:00
Duco van Amstel
da8e415ae1 Use logrus imports instead of log (#662) 2018-12-26 15:16:09 +01:00
Patrick Connolly
f5659d455d Sync channel topics between Slack bridges (#585)
Added logic to allow for configurable synchronisation of topics and purposes of channels between Slack bridges.
2018-11-26 09:47:04 +00:00
Wim
9f66f93641
Add option to send RAW commands after connection (irc). Fixes #490 (#604) 2018-11-25 19:32:16 +01:00
Wim
f4d4dc91b1
Add option to ignore failing bridge on start. Fixes #455 (#603) 2018-11-25 10:35:35 +01:00
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