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

741 Commits

Author SHA1 Message Date
Alexandre GV
ac4aee39e3
discord: Add AllowMention to restrict allowed mentions ()
* Add DisablePingEveryoneHere/DisablePingRoles/DisablePingUsers keys to config

* Add basic AllowedMentions behavior to discord webhooks

* Initialize b.AllowedMentions on Discord Bridger init

* Call b.getAllowedMentions on each webhook to allow config hot reloading

* Add AllowedMentions on all Discord webhooks/messages

* Add DisablePingEveryoneHere/DisablePingRoles/DisablePingUsers to matterbridge.toml.sample

* Change 'Disable' for 'Allow' and revert logic in Discord AllowedMentions

* Update Discord AllowedMentions in matterbridge.toml.sample

* Fix typo in DisableWebPagePreview

* Replace 'AllowPingEveryoneHere' with 'AllowPingEveryone'

* Replace 3 AllowPingEveryone/Roles/Users bools with an array

* Fix typo
2021-05-13 22:39:25 +02:00
Wim
a0bca42a7a
Update vendor ()
* Update vendored libs

* Fix slack api changes
2021-05-05 22:03:28 +02:00
Paul
b293e3fa75
Adding caption to send telegram images. Fixes ()
* Used tgbotapi caption option to attach caption to photos / documents

* remove "text/template/parse"

* added TGGetParseMode to clean up. Added tg upload function for video, audio and voice

* fixed varname Textout. Changed fileextension logic to avoid chaining regex

* fixed textout varname

* fixed parsemode varname

* gofmt

Co-authored-by: Wim <wim@42.be>
2021-04-03 23:15:19 +02:00
Wim
7466e1d014
Set ogg as default audiomessage when none found (whatsapp). Fixes () 2021-03-20 23:12:59 +01:00
James Lu
2a7f28606c
Declare GUILD_MEMBERS privileged intent (discord) ()
Without this declared, it seems that Discord will not send any member update
events after connection, even if the privileged gateway intent is enabled for
the bot in settings. This causes nick tracking to get out of sync when people
change their nicks after the bot connects.

See: https://discord.com/developers/docs/topics/gateway#gateway-intents
2021-03-20 22:46:36 +01:00
Ben Wiederhake
0450482e6e
Make lottie_convert work on platforms without /dev/stdout ()
Fixes .
2021-03-20 22:42:41 +01:00
Wim
be3dfb251d
Check rune length instead of bytes (telegram). Fixes () 2021-02-25 23:28:54 +01:00
Alexander
763bb95cea
Fix webhooks for channels with special characters (xmpp) () 2021-02-17 21:30:06 +01:00
Tadeo Kondrak
c147ba1da1
Handle Rocket.Chat attachments () 2021-02-15 22:34:14 +01:00
Qais Patankar
10f044c3dd
Use valid transmitter Log default (discord) ()
* Use valid transmitter Log default (discord)

Using a logger created by `log.NewEntry(nil)` would crash. (matterbridge does not encounter this issue as it updates the Log field manually.)
2021-02-15 22:20:08 +01:00
Alexander
ce5140febd
Fix panic when the webhook fails (xmpp) () 2021-02-15 22:18:30 +01:00
Wim
1624f10773
Pick up all the webhooks (discord) () 2021-02-01 20:44:34 +01:00
Ivanik
8764be7461
Add vk bridge ()
* Add vk bridge

* Vk bridge attachments

* Vk bridge forwarded messages

* Vk bridge sample config and code cleanup

* Vk bridge add vendor

* Vk bridge message edit

* Vk bridge: fix fetching names of other bots

* Vk bridge: code cleanup

* Vk bridge: fix shadows declaration

* Vk bridge: remove UseFileURL
2021-01-29 00:25:14 +01:00
Wim
5dd15ef8e7
Add an even more debug option (discord) ()
Enable discordgo debugging with debuglevel=1 under the [discord.xxx] section, for even more debugging fun.
2021-01-23 00:09:56 +01:00
Alexander
4ac6366706
Allow the XMPP bridge to use slack compatible webhooks (xmpp) ()
* Add mod_slack_webhook support to the XMPP bridge

* Replace b.webhookURL with b.GetString

* Do not return a message ID on webhook POST

* Add the XMPP webhook to the sample configuration
2021-01-21 22:50:04 +01:00
Paul
b039da1eba
Add jpe as valid image filename extension (telegram) () 2021-01-14 23:42:13 +01:00
Qais Patankar
8fcd0f3b6f
Improve Markdown in transmitter docs (discord) () 2021-01-03 18:57:06 +00:00
Wim
16fde6935c
Rename .oga audio files to .ogg (telegram) () 2021-01-02 00:55:20 +01:00
Qais Patankar
a9d8ac8bc0
Refactor "msg-parent-not-found" to config.ParentIDNotFound () 2020-12-31 18:01:57 +00:00
Qais Patankar
1a4717b366
Reject cross-channel message references (discord) ()
Discord message references have been designed in a way for this to
support cross-channel or even cross-guild references in the future.

This will ensure the ParentID is *not* set when the message refers to a
message that was sent in a different channel.
2020-12-31 16:21:37 +00:00
Qais Patankar
6cadf12260
Add a prefix handler for unthreaded messages (discord) () 2020-12-31 16:15:42 +00:00
Wim
19d47784bd
Add threading support with token (discord) ()
Webhooks don't support the threading yet, so this is token only.
In discord you can reply on each message of a thread, but this is not possible in mattermost (so some changes added there to make sure we always answer on the rootID of the thread).

Also needs some more testing with slack.

update : It now also uses the token when replying to a thread (even if webhooks are enabled), until webhooks have support for threads.
2020-12-31 16:59:47 +01:00
Qais Patankar
b89102c5fc
Fix 'webook' typo in discord/webhook.go () 2020-12-31 16:51:49 +01:00
James Lu
a9f89dbc64
Add support for stateless bridging via draft/relaymsg (irc) ()
* irc: add support for stateless bridging via draft/relaymsg

As discussed at https://github.com/42wim/matterbridge/issues/667#issuecomment-634214165

* irc: handle the draft/relaymsg tag in spoofed messages too

* Apply suggestions from code review

Co-authored-by: Wim <wim@42.be>

* Run gofmt on irc.go

* Document relaymsg in matterbridge.toml.sample

Co-authored-by: Wim <wim@42.be>
2020-12-30 18:21:32 +01:00
Qais Patankar
6de4c7e971
Update webhook documentation (discord) () 2020-12-17 20:27:52 +01:00
Qais Patankar
03dc51ffa2 Split Bdiscord.Send into handleEventWebhook and handleEventBotUser (discord) 2020-12-13 23:19:48 +01:00
Qais Patankar
aef2dcdfdd Move webhook specific logic to its own file (discord) 2020-12-13 23:19:48 +01:00
Qais Patankar
0494119bf4 Extract maybeGetLocalAvatar into its own function (discord) 2020-12-13 23:19:48 +01:00
Qais Patankar
0a17e21119 Remove WebhookURL support (discord) 2020-12-13 23:19:48 +01:00
Qais Patankar
52e2f926f4 Add initial transmitter implementation (discord)
This has been tested with one webhook in one channel.

Sends, edits and deletions work fine
2020-12-13 23:19:48 +01:00
Qais Patankar
611fb279bc Revert "Disable webhook editing ()" (discord)
This reverts commit c23252ab53.
2020-12-13 23:19:48 +01:00
Gary Kim
41b4e64be9
Update go-nc-talk (nctalk) ()
Signed-off-by: Gary Kim <gary@garykim.dev>
2020-12-10 00:06:27 +01:00
Wim
4913766d58
Parse fencedcode in ParseMarkdown. Fixes () 2020-12-06 19:38:32 +01:00
Wim
92da8c7044
Mark messages as read (matrix). Fixes () 2020-12-06 17:49:35 +01:00
Wim
2d3c26a4b2
Implement ratelimiting (matrix). Fixes () 2020-12-06 17:18:25 +01:00
Wim
8eba2d3e50
Make handlers run async (irc) ()
This makes the handlers run in a seperate go-routine in girc, and makes
sure that girc isn't blocked on executing PONG requests when
matterbridge takes a long time handling the incoming message.

This can happen when another bridge is in a backoff state where the
backoff time exceeds the IRC ping timeout.
2020-12-05 21:41:45 +01:00
Qais Patankar
c42167c6f4
Refactor guild finding code (discord) () 2020-12-03 22:36:08 +01:00
Sebastian P
44d182e2f9
Add nil checks to text message handling (mumble) () 2020-12-03 22:25:33 +01:00
Wim
ad95e35687 Rename jfif to jpg (whatsapp). Fixes 2020-11-29 15:37:20 +01:00
Wim
640a9995f4 Refactor handleTextMessage (whatsapp) 2020-11-29 15:37:20 +01:00
Wim
95625f6871 Refactor image downloads (whatsapp) 2020-11-29 15:37:20 +01:00
Wim
2c20f72a9c Handle audio downloads (whatsapp) 2020-11-29 15:37:20 +01:00
Wim
5ad788e768 Handle video downloads (whatsapp) 2020-11-29 15:37:20 +01:00
Wim
ed98c586c6 Add support for deleting messages (whatsapp) 2020-11-29 15:37:20 +01:00
Wim
3e865708d6 Refactor/cleanup code (whatsapp) 2020-11-29 15:37:20 +01:00
Simon THOBY
29e29439ee
Show mxids in case of clashing usernames (matrix) ()
Fixes .
2020-11-25 23:51:23 +01:00
Wim
0c19716f44
Join on invite (irc). Fixes () 2020-11-22 22:44:15 +01:00
Wim
b24e1bafa1
Add support for irc to irc notice (irc). Fixes () 2020-11-22 22:21:02 +01:00
Wim
64b899ac89
Retry until we have contacts (whatsapp). Fixes () 2020-11-22 21:42:54 +01:00
Wim
c23252ab53
Disable webhook editing (discord) ()
See https://github.com/42wim/matterbridge/issues/1255 and
https://github.com/qaisjp/go-discord-irc/issues/57

Webhook edits gets ratelimited which cause other problems with
matterbridge. Disabling for now.
2020-11-22 17:18:48 +01:00