5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-22 19:40:25 +00:00
Commit Graph

145 Commits

Author SHA1 Message Date
Alexander
d7b7ff7bb4
Preserve threading for messages with files (slack) (#1781)
* Preserve threading for slack messages with files

* Update bridge/slack/slack.go

Co-authored-by: Wim <wim@42.be>
2022-03-30 22:22:37 +02:00
Wim
6438a3dba3
Add support for deleting files from slack to discord. Fixes #1705 (#1709)
We create a new event EventFileDelete which will be used to delete
specific uploaded files using the Extra["file"] in the config.Message.

We also add a new NativeID key to the FileInfo struct which will contain
the native file ID of the sending bridge.

When a new file is added to the config.Message.Extra["file"] map, now
the bridge native file ID should be added here.

When the receiving bridge receives such a message, it should keep an
internal mapping of NativeID <> bridge fileid/message id. In the case of
discord we map it to the resulted discord message ID after uploading it.

Now when a bridge deletes a file, it should send a EventFileDelete and
setting the ID to the native file ID of the bridge.

When the receiving bridge will get this event it'll look into the
NativeID <> bridge id mapping to find their internal ID and use it to
delete the specific file on their side.

For now this is implemented for slack to discord but this will be add to
other bridges where useful.
2022-02-05 14:45:54 +01:00
Brian V
13bbeeaceb
Add space before file upload comment (slack) (#1554) 2021-07-27 17:52:30 +01:00
Wim
c86137449e
Add a MessageClipped option to set your own clipped message. Closes #1359 (#1487) 2021-05-27 21:45:23 +02:00
Wim
a0bca42a7a
Update vendor (#1461)
* Update vendored libs

* Fix slack api changes
2021-05-05 22:03:28 +02:00
Qais Patankar
a9d8ac8bc0
Refactor "msg-parent-not-found" to config.ParentIDNotFound (#1347) 2020-12-31 18:01:57 +00:00
Wim
c9cfa59f54
Do not use webhooks when token is configured (slack) (fixes #1123) (#1134) 2020-05-14 00:27:34 +02:00
Wim
e564c555d7
Clip too long messages on 3000 length (slack). Fixes #1081 (#1102) 2020-04-19 17:00:11 +02:00
Qais Patankar
d4acdf2f89
Use blocks not attachments (slack) (#1048)
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 #1039: messages sent to Slack being synced back (#1046)
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
Wim
250b3bb579
Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
Qais Patankar
1d708ab351 Suppress unhandled HelloEvent message (slack) (#913) 2019-10-04 00:19:50 +02:00
Wim
5619a75b05
Fix regression in autojoining with legacy tokens (slack). Fixes #651 (#848) 2019-06-14 00:42:55 +02:00
Duco van Amstel
fb2667631d Refactor channel and user management (slack) (#766) 2019-03-15 21:23:09 +01:00
Duco van Amstel
b638f7037a Force Slack link unfurling (#763) 2019-03-12 22:56:43 +01:00
Duco van Amstel
74699a8262 Split-out Slack user and channel management (#762) 2019-03-12 22:52:36 +01:00
Wim
1f1634ea59 Add extra debug option (slack) 2019-02-22 19:36:50 +01:00
Wim
57f156be83
Hint at thread replies when messages are unthreaded (slack) (#684) 2019-02-10 17:23:50 +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
Qais Patankar
8522d8f29c Fix #668 strip lang in code fences sent to Slack (#673) 2019-01-04 20:32:58 +01:00
Wim
53c86702a3
Add wait option for populateUsers/Channels (slack) Fixes #579 (#653)
When setting wait to true, we wait until the populating isn't in progress anymore.
This is used on startup connections where we really need the initial information
which could take a long time on big servers.
2018-12-15 23:11:03 +01:00
Duco van Amstel
a2754f15fc Enable errcheck linter (#646) 2018-12-08 17:04:10 +01:00
Wim
859ebad55d
Make slack-legacy change less restrictive (#626) 2018-12-02 23:09:21 +01:00
Patrick Connolly
e538a4d304 Update nlopes/slack to 4.1-dev (#595) 2018-12-01 19:55:35 +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
f716b8fc0f
Merge pull request #606 from 42wim/fix-590 2018-11-25 20:40:22 +01:00
Wim
f00d4d7d3f Make sure threaded files stay in thread (slack). Fixes #590 2018-11-25 19:27:45 +01:00
Wim
0929535b2e Do not post empty messages (slack). Fixes #574 2018-11-25 19:26:47 +01:00
Wim
8869e253ca Handle deleted/edited thread starting messages (slack). Fixes #600 (#605) 2018-11-25 10:08:57 +00:00
Wim
ae32bae791
Add protocol to msg.ID in cache (#596) 2018-11-19 21:28:23 +01:00
Wim
32f57b7c26 Add links to slack bot and legacy config in error message (slack) 2018-11-18 17:14:47 +01:00
Duco van Amstel
ce21ba1545 Fix golint linter issues and enable it in CI (#593) 2018-11-15 20:43:43 +01:00
Patrick Connolly
09713d40ba Fix file caching issue (slack). #572 (#575) 2018-11-14 21:00:21 +01:00
Duco van Amstel
e19ba5a06a Add new Slack connection and forked legacy Slack bridge (#582) 2018-11-13 20:51:19 +01:00
Duco van Amstel
e9419f10d3 Restore file comments coming from Slack (#583) 2018-11-12 15:58:00 +01:00
Duco van Amstel
2f042ad915 Add more rate-limit handling (slack) (#581) 2018-11-10 22:09:41 +01:00
Wim
78401214b0 Make scopelint happy 2018-11-08 22:29:34 +01:00
Wim
1e0bb3da95 Make gocritic linter happier 2018-11-08 22:01:29 +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
Duco van Amstel
d2a1dc792f Refactor and clean-up handlers. (slack) (#533) 2018-11-07 21:35:59 +01:00
David Hill
0e2522279e Clean up various stuff (#508)
* various cleanups
2018-11-07 20:36:50 +01:00
Duco van Amstel
a1bf37e457 Do not join Slack channel without API access (slack) (#563) 2018-11-07 17:25:00 +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
Duco van Amstel
6911458d15 Clean up message send logic (slack). (#531) 2018-10-22 19:43:57 +02:00
Duco van Amstel
6238effdc2 Clean up user and channel information management (slack) (#521) 2018-10-16 20:34:09 +02:00
Duco van Amstel
498377a230 Clean up code and strengthening (slack) (#519)
Changes include:
- Refactor of strings into package-wide constants.
- Predeclaration of regexps to be instantiated at package load time.
- Checking of unchecked errors.
- Structural changes:
  - Adding verifications to type-casting code.
  - Remove unnecessary 'len(X) > 0' checks before iterating over X.
  - Remove unnecessary 'else' clause after 'if' with 'return'.
  - Unexporting of public fields of Bridge struct.
- Formatting:
  - One-field-per-line struct definitions.
2018-10-13 01:02:14 +02:00
Duco van Amstel
e15b0e04b8 Refactor slack bridge prelude (#517)
Distributing the source of the Slack bridge across multiple files to
increase readability and as a prelude to various refactors and
clean-ups.
2018-10-12 23:16:34 +02:00
Wim
52dbd702ad Get up to 1000 channels and private/mp/im channels (slack). Related to #489 2018-08-28 22:33:07 +02:00
Wim
b51fdbce9f Add caching to fix issue with slack API changes (slack). #481 2018-08-18 00:12:05 +02:00
Wim
7690be1647 Fix slack file/image downloads after api changes (slack) 2018-08-10 00:39:07 +02:00