Commit Graph

126 Commits

Author SHA1 Message Date
David Taylor 610364ff6d
FEATURE: Add support for slack message shortcuts for transcripts (#68)
Once configured, this adds a new item to the context menu of slack messages. When clicked, the menu item will generate a transcript and present the user with a custom "Post to Discourse" modal. This provides the same functionality as the existing slash-command interface, but is much more user friendly.
2021-04-22 18:50:11 +01:00
David Taylor 08e6718722
FEATURE: Improve formatting for Slack transcript messages (#70)
- Fix multi-line code blocks
- Add strikethrough support
- Fix HTML entities inside code blocks
- Do not process formatting inside code blocks
- Ensure links are never created with no URL
- Replace - with _ in emoji names
2021-04-22 18:49:21 +01:00
Robin Ward 8c166e1b06 Revert "Add username and fullname for formatting (#65)"
This reverts commit 7f5ef4f8f5.
2021-03-16 10:27:14 -04:00
Gökhan Gurbetoğlu 7f5ef4f8f5
Add username and fullname for formatting (#65)
Added username and fullname to make them usable in the custom formatting for the posts.
2021-03-15 11:19:05 -04:00
David Taylor 4261814162
FIX: Improve error handling for slack transcript generation (#63)
- Stop using `break` in a block - it doesn't work. The failure here was hidden because it was within a `defer` block, so would not cause a server error
- Refactor the error handling so that the error is passed back to Slack and displayed to the user
- Return specific error messages for user / message-history / message errors
- Tidy up the SlackCommandController to make all non-requestable methods private
- Add a test to ensure error messages are passed correctly to Slack
2021-03-01 19:07:31 +00:00
David Taylor 13fea5b803
FEATURE: Google Chat integration (#57) 2021-01-26 20:33:03 +00:00
David Taylor 00ec1f486a
FIX: Relax validation for teams webhook urls to support custom domains (#56) 2021-01-26 17:45:49 +00:00
Mathieu Trudel-Lapierre 0c0e86b772
FEATURE: Add support for Webex Teams (#49) 2020-12-11 09:43:03 +00:00
David Taylor 1dc753771b
FIX: Update telegram webhook correctly and remove old code (#46)
The `site_setting_changed` event passes the setting name as a symbol, not a string. This commit also removes the backwards-compatible `site_setting_saved` event, which was deprecated in 2.3.0.
2020-11-02 16:58:29 +00:00
jjaffeux d5808f4e9a FIX: these are not spe and dont have response.parsed_body 2020-09-25 21:08:28 +02:00
jjaffeux d483f4ae5a DEV: s/JSON.parse(response.body)/response.parsed_body 2020-09-25 20:47:30 +02:00
David Taylor bb4143a695
FIX: Allow discord.com webhook URLs 2020-08-18 00:34:59 +01:00
David Taylor bdca153a09
FIX: Send new topic Slack notifications to the correct thread
This applies when topics are created using the slack transcript feature, and there is a rule configured with filter=thread
2020-08-14 19:15:02 +01:00
Tosin Sonuyi 1a49df23c6
update groupme message format for clarity (#41) 2020-08-10 12:29:08 -04:00
Ahmed Gagan fa5ef22262
FEATURE: Support for Microsoft Teams webhooks (#42) 2020-07-29 17:20:02 +01:00
Robin Ward 509360e190 FIX: You can't return from a block, especially an async one 2020-06-26 11:52:00 -04:00
Guo Xiang Tan 424c477043
Make rubocop happy. 2020-06-17 15:45:10 +08:00
Michael K Johnson da9106127a
FEATURE: Enable optional support for threading slack posts (#38)
When creating a new Discourse post from slack with the `post` feature, record the
slack `ts` thread ID for the resulting topic post using an HTML comment to pass
the `ts` through.

When notifying slack of new Discourse posts, record the slack `ts` thread ID in
the post's topic if it has not yet been recorded. (Normally, this will be done
for the topic post, except where notifications are being posted for old topics
before this feature was created.)

Add a new rule filter `thread` which posts threaded responses to slack if there
is a `ts` recorded for the post topic.

Modify the `trigger_notifications` interface to enable other integrations to
implement similar functionality.

Present the `thread` rule in the help text and admin UI only for the slack
providers.

https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759
2020-06-15 16:45:25 +01:00
Tosin Sonuyi ccbc41428b
GroupMe added as Provider (#36)
* adds groupme configuration and relative

* first pass at groupme provider

* add group id site setting w/ english translation

* rework to use bots groupme api intstead of developer, no access tokens reqd

also should catch 404 response codes

* add strings to locale yml files for i18n

* better error handling for multi-bot case

* add channel param for separate Groupme instances, include name in errorbody

* bugfix for multi bot msg forwarding

this gives us the ability to treat diff groupme instances like slack channels, lots of people use them this way for better or worse. use case is certain category posts only go to a particular GM instance

* add spec for groupme provider

* fix channel param constraint

* specify channels by groupme name, not bot api token

* fix some linting issues w/ spacing

* newline and trailing space lint fixes
2020-05-11 15:10:37 -04:00
nepeat c92b93ded1 FEATURE: Include category title and color in Discord payload (#19) 2020-01-06 16:47:00 +00:00
Saj Goonatilleke 05d4338a12 FIX: telegram: Not all channel posts contain text (#34)
The `text` field is marked optional, and is not guaranteed to exist:

https://core.telegram.org/bots/api#message

We should silently ignore these actions (while responding with a
positive acknowledgement) instead of throwing a `NoMethodError`.
2019-11-20 11:45:34 +01:00
Penar Musaraj 6fcf381751 Rubocop redundant return fix 2019-11-14 15:03:49 -05:00
David Taylor 7e5dc5acc1 FIX: Allow slash commands to set rules in private groups
The Slack 'slash commands' API does not provide the user-friendly group name, so we must use the group ID. We could use the API to obtain the group name, but it would require adding additional scopes to the app.
2019-09-30 13:27:35 +01:00
Raimundo Herrera 695d56a3dd FEATURE: support for slack custom username (#22)
* FEATURE: support for slack custom username

* make slack username setting backwards compatible

* fix slack username behavior when empty string
2019-09-11 10:08:40 -04:00
Robin Ward 82351a790c FIX: An error would be raised if fewer than "skip_messages" existed 2019-08-07 16:59:34 -04:00
Leon Xu 0b85c2a0e5 FIX: undefined local variable or method `site_setting_saved' (#30) 2019-08-02 10:05:33 +01:00
James Nylen 5ca3652ba7 Use Slack display names instead of the "name" field (#29)
* Use Slack display names instead of the "name" field

The "name" field is the left-hand side of the email address in many
cases.  This information is not otherwise available so we shouldn't
expose it in forum posts.

* Fall back to real_name, add comments

* Store users as a hash

This should avoid a lot of O(n) lookups

* Format user mentions with the correct name also

* Fix the tests (first try)

* Fix the tests (second try); add a test for user mentions

* Fix the tests (third try)

* Empty commit to trigger Travis

* Fix the tests (fourth try)

* Fix the tests (fifth try)

* Change spaces to underscores

* Updates per feedback
2019-07-04 14:50:07 -04:00
Guo Xiang Tan cef085d0b6 Fix the build. 2019-06-06 10:26:24 +08:00
Guo Xiang Tan 3eb8e97f37 DEV: Remove deprecation warning. 2019-06-06 09:51:40 +08:00
David Taylor f75903cae5 FIX: Determine uncategorized category name using new core pattern 2019-06-04 18:47:32 +01:00
Tomas Varaneckas 95d8d5e9ea FIX: make plugin compatible with older Discourse (#28)
@tgxworld
2019-05-16 08:24:17 +08:00
Guo Xiang Tan ac288b9300 Add frozen string literal comment to files. 2019-05-13 10:37:49 +08:00
David Taylor bf30b755cf Remove HipChat integration
As of February 15th, HipChat has been declared end-of-life. For more information, see https://community.atlassian.com/t5/Stride-articles/Stride-and-Hipchat-Cloud-have-reached-End-of-Life-updated/ba-p/940248
2019-04-15 17:56:01 +01:00
David Taylor b7dff35722 FIX: Handle `mailto` links in slack messages 2019-01-03 11:14:26 +00:00
Tisza Gergő bf1939f08d FEATURE: Add Matrix option for using plain text instead of notice (#25)
Notices are problematic on certain IRC clients and lead to bans
if the Matrix channel is bridged to IRC.
2018-12-28 23:44:43 +00:00
Mateusz Bugowski 1a08d64785 FIX: loading user.list longer than 1000 (#24) 2018-12-14 01:03:49 +00:00
Guo Xiang Tan 2b357b2dfe Add support for new upload site settings.
44391ee8ab
2018-11-14 15:17:44 +08:00
Guo Xiang Tan c44ac56d32 Make rubocop happy. 2018-06-08 09:52:35 +08:00
Sam d481205999
Merge pull request #20 from davidtaylorhq/private_slash_commands
Slash command and transcript improvements
2018-05-18 10:47:37 +10:00
David Taylor 0ed6343874 Add basic support for thread transcripts 2018-04-08 03:22:58 +01:00
David Taylor 427cfc2305 Use generic ‘conversations’ API endpoint to enable transcripts for slack IMs and groups 2018-04-08 02:50:46 +01:00
David Taylor 180011c097 Fix slash commands in private groups 2018-04-08 02:26:36 +01:00
rohitsden 79288fc254 Update HipChat WebHook URL validation to check for anything that isn't space. 2018-01-13 21:58:40 -05:00
rohitsden 324aca0fad Fix HipChat WebHook URL validation. 2018-01-12 19:36:51 -05:00
Francis Brunelle 1078f8089e use SiteSetting.chat_integration_matrix_excerpt_length for the Matrix provider (#17) 2017-12-27 16:35:32 +08:00
Vinoth Kannan 8168c717a8 Return help text if message text is unavailable 2017-12-06 13:07:45 +05:30
Joshua Rosenfeld 2ca3fb1d21
Remove thumb_url from Rocket.Chat
Results in broken thumbnail appearing in all posts.
2017-11-30 09:56:47 -05:00
David Taylor da9ee8dcb5 Fix mattermost icon selection 2017-11-27 16:14:43 +08:00
David Taylor 5f555849e5 Replace `render nothing: true` with a JSON response. This has the added benefit of showing a “loading” message (#12)
render:nothing was producing an error 500 for some reason
2017-11-27 16:08:19 +08:00
David Taylor b69abe3913 Include attachments in message selection dropdowns (#13)
* Include attachments in message selection dropdowns

* DRY up message attachment string generation

* Add specs for attachments in UI
2017-11-27 16:07:54 +08:00