Commit Graph

52 Commits

Author SHA1 Message Date
Robin Ward 509360e190 FIX: You can't return from a block, especially an async one 2020-06-26 11:52:00 -04: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
Jarek Radosz a3face98e9 DEV: Change specs to not rely on a trailing whitespace 2020-05-02 09:50:48 +02:00
Robin Ward a41abfbfd6 FIX: Rubocop 2020-02-19 14:16:39 -05:00
Robin Ward 82351a790c FIX: An error would be raised if fewer than "skip_messages" existed 2019-08-07 16:59:34 -04: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 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
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
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
Sam ec216e69c5 correct spec 2018-01-12 15:05:57 +11:00
Sam 3069124273 correct specs 2018-01-12 14:48:00 +11:00
David Taylor da9ee8dcb5 Fix mattermost icon selection 2017-11-27 16:14:43 +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
David Taylor 6ed0deedf8 Don’t load responses to threads (#14)
* Don’t load responses to threads

* Add test case for ignoring threaded messages

* Appease rubocop
2017-11-27 16:07:25 +08:00
Maja Komel 7889691cdb fix rubocop offenses 2017-10-17 12:21:36 +02:00
Maja Komel 92d6a6ba0e Add notification support for Flowdock 2017-10-16 16:44:21 +02:00
Guo Xiang Tan 6bbac0a1e9 Maintain backwards compatibility with existing slash command. 2017-10-10 13:30:44 +08:00
Guo Xiang Tan 49f58ec190 Fix tests to work with Rails 5.1. (#8) 2017-09-25 11:06:27 +08:00
David Taylor 47a6a89e5a Defer processing of transcripts to avoid timeouts 2017-09-15 23:12:02 +01:00
jafethdc e90d65f5d5 Add notifications support for Gitter 2017-08-30 18:11:06 -05:00
David Taylor 5ea6553236 Add support for Rocket.Chat 2017-08-23 16:43:27 +01:00
David Taylor 9b229b63f9 Use generic messages API for Zulip
It is now available to bots, so there is no need for the custom discourse endpoint any more :)
2017-08-23 12:36:11 +01:00
David Taylor e3f09d8eb5 Add Zulip support 2017-08-21 23:34:04 +01:00
David Taylor 148dd8df6b Tidy up Slack provider implementation 2017-08-21 15:28:37 +01:00
David Taylor 142925e4c4 Correct rubocop offence 2017-08-15 18:26:11 +03:00
David Taylor 064079a4ed Add auto-detection of first message in conversation 2017-08-15 18:19:24 +03:00
David Taylor 3314721232 RSpec tests for slack transcript posting 2017-08-15 17:44:51 +03:00
David Taylor 9dc5445b7b Fix spec 2017-08-04 00:54:11 +01:00
David Taylor 4f9ad4efef Correct rubocop offenses 2017-08-01 20:53:39 +01:00
David Taylor f1df1f5234 Fix discord avatar URL 2017-07-31 14:47:27 +01:00
David Taylor 5a4faa637f Add matrix support 2017-07-27 17:09:44 +01:00
David Taylor dac2dd3b25 Fix slack transcript spec 2017-07-26 20:04:46 +01:00
David Taylor e733c2564f Add mattermost slash command support 2017-07-26 13:09:05 +01:00
David Taylor 61a4fd2c23 Add Mattermost support 2017-07-25 22:14:48 +01:00
David Taylor c51e8ec3b5 Add HipChat support 2017-07-24 19:22:19 +01:00
David Taylor 8ca4797797 Add transcript posting support to slack 2017-07-24 16:43:37 +01:00
David Taylor 0d9b251030 Allow telegram to send notifications to ‘broadcast channels’ 2017-07-21 19:12:31 +01:00
David Taylor 701e246ad2 Support slash commands in telegram group chats 2017-07-21 17:55:33 +01:00
David Taylor b5e2741214 Add discord support 2017-07-21 15:48:57 +01:00
David Taylor 970c38c7fe Add telegram specs 2017-07-19 21:26:16 +01:00
David Taylor 4422f14c6d Move slash command specs into helper_spec 2017-07-19 18:22:50 +01:00
David Taylor ebb6fa947d Update slack provider to deal with new channel structure 2017-07-13 23:21:15 +01:00
David Taylor 52b8e3f3a6 Remove unneeded comments 2017-07-07 11:51:19 +01:00
David Taylor 95dd6bc09c Add error handling to the slack API requests, and associated tests 2017-07-07 11:23:25 +01:00
David Taylor f001320574 Add integration tests for slack ‘slash commands’
Adapted from existing slack plugin
2017-07-06 23:30:27 +01:00