3
0
mirror of https://github.com/42wim/matterbridge.git synced 2024-12-22 19:22:38 +01:00
Commit Graph

737 Commits

Author SHA1 Message Date
Wim
4f8b19c686
Add PingDelay option (irc) () 2020-10-21 01:14:13 +02:00
Dellle
3188a9ffe6
Add username formatting for all events (matrix) () 2020-10-20 21:22:31 +02:00
Wim
61569a8610
Add even more debug for irc () 2020-10-20 00:33:15 +02:00
Gary Kim
950f2759bd
Add support for downloading files (nctalk) ()
Signed-off-by: Gary Kim <gary@garykim.dev>
2020-10-19 23:16:34 +02:00
Wim
25c82ddf02
Use vendored whatsapp version () 2020-10-12 00:05:17 +02:00
Gary Kim
219a5453f9
Append a suffix if user is a guest user (nctalk) ()
Signed-off-by: Gary Kim <gary@garykim.dev>
2020-10-01 22:59:35 +02:00
Sebastian P
214a6a1386
Add Mumble support () 2020-10-01 22:50:56 +02:00
Dellle
a42e488e58
Add username for images from WhatsApp () 2020-09-26 21:32:57 +02:00
Ben Wiederhake
06eb89b05b
Matrix: Permit uploading files of other mimetypes ()
This includes at least c-source-files, cpp-source-files,
markdown-files, Rust-files, and plaintext files.
We already allow uploading arbitrary executables. (And javascript-files,
coincidentally.) Not permitting these other text files would be highly unexpected.
2020-09-26 21:28:24 +02:00
Wim
cec63546ff
Check location of avatarURL (zulip). Fixes () 2020-09-04 22:50:57 +02:00
Tilo Spannagel
712385ffd5
Format rich object strings (nctalk) ()
Signed-off-by: Tilo Spannagel <development@tilosp.de>
2020-08-31 01:49:43 +02:00
Tilo Spannagel
f9928c9e25
Switch to upstream gomatrix ()
Signed-off-by: Tilo Spannagel <development@tilosp.de>
2020-08-30 14:01:52 +02:00
Gary Kim
a0741d99b8
Add TLSConfig to nctalk ()
Signed-off-by: Gary Kim <gary@garykim.dev>
2020-08-30 13:49:26 +02:00
NikkyAI
c63f08c811
Sent loopback messages to other websockets as well (api) () 2020-08-27 22:28:03 +02:00
escoand
58b6c4d277
Handle broadcasts as groups in Whatsapp ()
The current way to get the correct JID of a WhatsApp group is to dump all JIDs to the log and grab the right one. This is working for for groups fine but not for broadcast, as they are not print out.

According to https://www.npmjs.com/package/@noamalffasy/js-whatsapp we have these possibilities:
* Chats: `[country code][phone number]@s.whatsapp.net`
* Groups: `[country code][phone number of creator]-[timestamp of group creation]@g.us`
* Broadcast Channels: `[timestamp of group creation]@broadcast`

But the bridge does currently interprets (and prints) the only second option.
2020-08-26 22:27:50 +02:00
NikkyAI
27c02549c8
Replace gorilla with melody for websocket API () 2020-08-26 22:27:00 +02:00
Wim
d5feda5c8a
Fix error loop (zulip) ()
Fixes 
2020-08-25 00:12:13 +02:00
Wim
2f506425c2
Update whatsapp vendor and fix a panic ()
* Fix another whatsapp panic

* Update whatsapp vendor
2020-08-24 23:35:08 +02:00
Wim
56159b9bce
Sleep when ratelimited on joins (matrix). Fixes () 2020-08-24 00:12:30 +02:00
Ben Wiederhake
b2af76e7dc
Support Telegram animated stickers (tgs) format ()
This is half a fix for 

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
Dellle
63a1847cdc
Remove HTML formatting for push messages () ()
When there is a valid HTML formatting then remove this in the cleartext
field of the matrix client. This leads to nicer push messages on
smartphone apps.

Fix 
2020-08-20 22:41:53 +02:00
Wim
4e50fd8649
Use mattermost v5 module () 2020-08-10 00:29:54 +02:00
Wim
ebd2073144
Handle panic in whatsapp. Fixes () 2020-07-30 23:55:31 +02:00
Gary Kim
71a5b72aff
Add Nextcloud Talk support ()
Signed-off-by: Gary Kim <gary@garykim.dev>
2020-07-18 16:08:25 +02:00
z3bra
213bf349c3
Add an option to log into a file rather than stdout ()
Use Logfile option in the `[general]` section
2020-07-18 15:46:19 +02:00
Andrey Groshev
a94fe55886
Fix MarkdownV2 support in Telegram () 2020-07-12 22:40:22 +02:00
haykam821
9b22f16497
Add websocket to API ()
Co-authored-by: Qais Patankar <qaisjp@gmail.com>
2020-07-12 21:13:28 +02:00
Nathanaël
1fee323247
Reload user information when a new contact is detected (whatsapp) ()
Before returning an empty string, we refresh the WhatsApp contacts and if we found the one we wanted, we can return a real name. Fixes 
2020-06-25 00:35:49 +02:00
Qais Patankar
a41accd033
Add sane RemoteNickFormat default for API () 2020-06-25 00:25:10 +02:00
James Lu
37f7caf7f3
Skip gIRC built-in rate limiting (irc) ()
By default, gIRC rate limits all outgoing messages. 
Since matterbridge already implements message throttling, this is extra layer of throttling is not necessary.
2020-06-24 23:57:37 +02:00
TheHolyRoger
5847f7758c
Only colour IRC nicks if there is one. () 2020-06-24 23:48:54 +02:00
Wim
7f7ca697a0
Ignore non-user messages (msteams). Fixes ()
Ignore these messages for now, also add a extra
debug option for msteams so we can dump the whole
message.
2020-05-24 15:49:24 +02:00
Alexander
900375679b
Prevent re-requesting avatar data (xmpp) ()
Prevent asking the server again and again for a
user's avatar if the server does not respond to
our initial request.
2020-05-24 14:07:36 +02:00
Wim
393f9e998b
Update dependencies / vendor () 2020-05-24 00:06:21 +02:00
Wim
ba0bfe70a8
Add StripMarkdown option (irc). ()
Enable `StripMarkdown` to strip markdown for irc.
2020-05-23 21:46:15 +02:00
Wim
3c4a3e3f75
Implement xep-0245 (xmpp). Closes () 2020-05-23 20:51:04 +02:00
Wim
274fb09ed4
Fix forward from hidden users (telegram). Closes ()
Use ForwardDate to check if a message is forwarded.
If we have a nil ForwardedFrom then make this an unknown user.
2020-05-23 19:15:26 +02:00
Wim
d44598a900
Add an option to disable sending HTML to matrix. Fixes () 2020-05-14 00:37:41 +02:00
Wim
c9cfa59f54
Do not use webhooks when token is configured (slack) (fixes ) () 2020-05-14 00:27:34 +02:00
Tiago Epifânio
7062234331
Avoid creating invalid url when the user doesn't have an avatar (matrix) () 2020-05-11 00:21:56 +02:00
Qais Patankar
9754569525
Fix webhook EventUserAction messages being skipped (discord) ()
Fixes 
2020-05-11 00:20:35 +02:00
Qais Patankar
52a071e34d
Fix : missing space before embeds (discord) () 2020-05-07 00:19:48 +02:00
Qais Patankar
2d8f749e36
Fix : replaceAction "_" crash (discord) () 2020-04-25 14:22:22 +02:00
Wim
eaf92fca4d
Add an ID cache (discord). Fixes ()
When a webhook "edits" a message, it does this by deleting the message
and creating a new one with the new content.

On creation of this new message, we'll get another ID then already is
know by the gateway in its id cache. So we add it in our own cache and
replace it whenever we want to edit/delete it again.
2020-04-21 23:35:46 +02:00
Wim
d99c54343a
Remove panics and retry polling on failure (msteams). Fixes () 2020-04-21 19:29:24 +02:00
Wim
e564c555d7
Clip too long messages on 3000 length (slack). Fixes () 2020-04-19 17:00:11 +02:00
Wim
f7ec9af9e8
Add extra space before colon in attachments (irc). Fixes () 2020-04-19 16:45:53 +02:00
Wim
4d93a774ce
Ignore non-critical errors (whatsapp). Fixes () 2020-04-19 13:45:35 +02:00
Wim
9190365289
Add JoinDelay option (irc). Fixes () 2020-04-19 00:46:35 +02:00
Wim
57794b3b9f
Prevent image/message looping (slack). Fixes ()
Also check for our matterbridge ID in Blocks set in SubMessages.
2020-04-18 22:30:49 +02:00
ldruschk
8e6ddadba2
Relay Joins/Topic changes in RocketChat bridge ()
This pull request properly sets the events EventJoinLeave and EventTopicChange for messages from the RocketChat bridge and drops messages which are neither one of those events nor plain messages.
2020-04-18 22:00:35 +02:00
Alexander
7183095a28
Implement User Avatar spoofing of XMPP users ()
* Implement User Avatar spoofing of XMPP users
2020-04-16 22:16:25 +02:00
Wim
8950575bfb
Update Rhymen/go-whatsapp vendor and whatsapp version () 2020-04-09 22:30:08 +02:00
Wim
8d08e348a9
Reset start timestamp on reconnect (whatsapp). Fixes () 2020-03-31 23:26:53 +02:00
Wim
29f658fd3c Use DebugWriter after upstream changes (xmpp) 2020-03-29 15:03:24 +02:00
Wim
0df2539641
Use upstream yaegashi/msgraph.go/msauth (msteams) () 2020-03-28 23:44:49 +01:00
Wim
1aa662f763
Update client version whatsapp. Fixes ()
See https://github.com/Rhymen/go-whatsapp/issues/305
2020-03-28 00:18:03 +01:00
Qais Patankar
98033b1ba7
Don't transmit typing events from ourselves (slack/discord) () 2020-03-22 18:39:11 +01:00
Qais Patankar
af0acf0dae
Strip extra info from emotes (discord) () 2020-03-22 14:16:31 +01:00
Qais Patankar
802c80f40c Update vendor yaegashi/msgraph.go to v0.1.2 (1) 2020-03-22 00:02:48 +01:00
Wim
281016a501
Fix duplicate separator on empty description/url (discord). Fixes ()
Make this work for all possible cases.
Add tests
2020-03-21 21:27:17 +01:00
Qais Patankar
d4acdf2f89
Use blocks not attachments (slack) ()
This removes the extra space below messages, as shown in
https://user-images.githubusercontent.com/923242/77235190-a3359980-6bab-11ea-8b7b-697d730ae5c1.png
2020-03-21 21:03:12 +01:00
Qais Patankar
0951e75c85
Fix : messages sent to Slack being synced back ()
This is a regression from https://github.com/42wim/matterbridge/pull/581#issuecomment-562937576

Behaves the same as 95190f11bf
2020-03-21 20:12:30 +01:00
Jakub
6b017b226a
Support JSON and YAML config formats ()
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2020-03-18 23:20:29 +01:00
Qais Patankar
9e3bd7398c
Fix : warning when handling inbound webhooks (discord) () 2020-03-18 23:12:48 +01:00
Qais Patankar
79f764c7a8 Refactor webhook permission checks 2020-03-18 23:10:47 +01:00
Qais Patankar
b5dc4353fb Fix : spotty webhook permission verification 2020-03-18 23:10:47 +01:00
Qais Patankar
2fbac73c29
Ignore ConnectingEvent (slack) () 2020-03-18 23:03:20 +01:00
Wim
9785edd263
Remove replace directives and use own fork to make go get work again ()
See https://github.com/golang/go/issues/30354
go get doesn't honor the go.mod replace options.
2020-03-08 17:08:18 +01:00
Wim
3f06a40bd5 Support code snippets from msteams 2020-03-01 22:19:33 +01:00
Wim
68f43985ad Add scopes again 2020-03-01 22:19:33 +01:00
Wim
915ca8f817 Make linter happy and cleanup (msteams) 2020-03-01 22:19:33 +01:00
Wim
a65a81610b Support threading from other bridges to msteams 2020-03-01 22:19:33 +01:00
Wim
8eb6ed5639 Support receiving attachments from msteams 2020-03-01 22:19:33 +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
Wim
250b3bb579
Use upstream slack-go/slack again () 2020-03-01 20:59:19 +01:00
Wim
e343db6f72
Make avatars download work with mediaserverdownload (telegram). Fixes () 2020-02-15 18:31:40 +01:00
Wim
54ed6320c2 Add support for avatars from matrix. () 2020-02-10 00:06:54 +01:00
Wim
1985873494 Implement basic reconnect (whatsapp). Fixes () 2020-02-09 22:11:46 +01:00
Qais Patankar
8ae5917659
Be less lossy when throttling IRC messages ()
Note that msg.Text and chucking it through a chan is OK: https://play.golang.org/p/MTfT3YSsgPX
2020-02-09 22:10:18 +01:00
Qais Patankar
c91bfd08d8 Add ability to procure avatars from the destination bridge ()
* 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
c01c8edeb8 Fix go-keybase-chat-bot api changes 2020-02-08 18:33:05 +01:00
Qais Patankar
1420f68050 Check only bridged channels for PermManageWebhooks (discord) ()
* Check only bridged channels for PermManageWebhooks

* add note
2020-02-08 15:13:23 +01:00
Martijn Braam
c0be3e585a
Enable intra-word emphasis supression in markdown ()
This fixes plain links sent to Matrix being broken if they contain
underscores. Fixes issue 
2020-02-04 13:22:05 +01:00
Wim
1bf46b7711
Fix duplicated messages (sshchat). Fixes () 2020-02-02 22:08:37 +01:00
Wim
b85bae31d9
Show file comment in webhook if normal message is empty (discord). Fixes () 2020-02-02 21:14:54 +01:00
Wim
f8ad877601
Add DisableWebPagePreview option (telegram). Closes () 2020-02-02 18:53:04 +01:00
Wim
585d1556c1
Disable smartypants in markdown parser. Fixes , () 2020-02-02 18:35:43 +01:00
Wim
7486555875
Fail with message instead of panic. () 2020-02-01 15:23:50 +01:00
Humorhenker
fc30b1bacc
Add QuoteLengthLimit option (telegram) fixes ()
* 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
4c44515f9d
Fix channel ID problem with multiple gateways (discord). Fixes () 2020-01-09 23:54:04 +01:00
Guillaume Lazzara
c9d5f4c898 Add support for WhatsApp media (jpeg/png/gif) bridging ()
* Whatsapp image bridging

* Prevent double message in telegram when media with caption received

Co-authored-by: imShara <shara@protonmail.com>
2020-01-09 18:14:01 +01:00
c0ncord2
810c150781 move stripCustomoji logic to default Tengo script ()
*  move stripCustomoji logic to default Tengo script 

Removing the image ID from the message (without any possibility of recovering it later) is a loss of valuable data that prevents users from giving support to custom emoji via Tengo scripts.

* bugfix - do send colors to other irc bridges

"if we're not sending to an irc bridge we strip the IRC colors"

Co-authored-by: c0ncord <59654954+c0ncord@users.noreply.github.com>
2020-01-09 18:02:53 +01:00
Wim
1f830963f6
Return when we have only WebhookURL (mattermost). Fixes () 2019-12-15 23:49:17 +01:00
Benjamin
0917dc8766 Update markdown parsing library to github.com/gomarkdown/markdown () 2019-11-17 21:18:01 +01:00
Gonçalo Ribeiro
c394de0c88 Add support for receiving attachments (keybase) () 2019-11-01 22:29:52 +01:00
Wim
0bc159341d
Update vendor ()
* Update vendor

* Fix godiscord api change
2019-10-27 01:45:57 +02:00
Wim
45bf1fd63a
Convert slack bold/strike to correct markdown (slack). Fixes () 2019-10-27 01:10:59 +02:00
Wim
ff0de85817
Remove obsolete file upload links (discord). Fixes ()
Since v1.16.0 we now can upload files via webhook.
Old way of showing files with webhook only setup can be removed.
2019-10-27 01:10:43 +02:00
Wim
727fa9f929
Add support for uploading application/x and audio/x (matrix). Fixes () 2019-10-27 00:06:44 +02:00