Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slack Event API Support v2 #89

Merged
merged 58 commits into from
Oct 5, 2018
Merged

Conversation

Half-Shot
Copy link
Contributor

@Half-Shot Half-Shot commented Sep 24, 2018

This is a follow-on from matrix-org/matrix-spec-proposals#66 with a few changes to tidy it up a bit. We are also now targetting the develop branch as these changes are experimental.

Goes without saying that @perissology did a huge amount of work in this and credit should go to them for the actual implementation.

@Half-Shot Half-Shot requested a review from a team September 24, 2018 14:03
@Half-Shot Half-Shot requested a review from a team September 27, 2018 21:43
@Half-Shot Half-Shot force-pushed the hs/perissology/slack-events branch 2 times, most recently from 4c537ce to 1529a6f Compare September 27, 2018 22:41
@Half-Shot Half-Shot force-pushed the hs/perissology/slack-events branch from 1529a6f to 73814f9 Compare September 27, 2018 22:42
@Half-Shot Half-Shot removed the request for review from a team September 27, 2018 22:44
@Half-Shot
Copy link
Contributor Author

Unassigning @matrix-org/bridge-team while there are still bugs present.

@Half-Shot Half-Shot mentioned this pull request Oct 3, 2018
@Half-Shot
Copy link
Contributor Author

Bugs were fixed in matrix-org/matrix-spec-proposals#93 because they were slightly unrelated, this just needs a review now.

@Half-Shot Half-Shot requested a review from a team October 3, 2018 16:06
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks largely okay. I'm assuming it has generally been tested, although there's two specific scenarios I'd like tested before this is merged (as mentioned oob):

  • Starting with a bridge that doesn't have this PR, bridge a room. Then upgrade. Does the bridge still work for that room?
  • When using this PR, does the provisioning API support using the old bridging method?

README.md Outdated
You will also need to determine the "channel ID" that Slack uses to identify
the channel, which can be found in the url `https://XXX.slack.com/messages/<channel id>/`.

2. Issue a ``link`` command in the administration control room with these
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we're going to duplicate list item numbers, can we use 1. please?

@@ -131,20 +131,31 @@ adminCommands.link = new AdminCommand({
required: true,
},
webhook_url: {
description: "Slack webhook URL",
description: "Slack webhook URL. Used with slack outgoing hooks integration",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/slack/Slack/

aliases: ['u'],
},
slack_bot_token: {
description: "Slack bot user token. Used with slack bot user & Events api",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/slack/Slack/

const CHANNEL_ID_REGEX = /<#(\w+)\|?\w*?>/g;
const CHANNEL_ID_REGEX_FIRST = /<#(\w+)\|?\w*?>/;

// (if this is an emote msg, the format is <@ID|nick>, but in normal msgs it's just <@ID>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comment references 'this' which makes no sense up here

message.text = message.text.replace(CHANNEL_ID_REGEX_FIRST, "#" + name);
iteration++;
}).catch((err) => {
console.log("Caught error " + err);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also helpful error messages would be awesome :)

}
iteration++;
}).catch((err) => {
console.log("Caught error " + err);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also get a more descriptive error message on this?

if (message.text) {
var text = substitutions.slackToMatrix(
message.text
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

surely this isn't hitting a line length limit if line 286 can be half a kilometre long

@Half-Shot
Copy link
Contributor Author

  • Starting with a bridge that doesn't have this PR, bridge a room. Then upgrade. Does the bridge still work >for that room?
  • When using this PR, does the provisioning API support using the old bridging method?

Tested both today and they work flawlessly, I was kinda surprised 😆

@Half-Shot Half-Shot merged commit 0a28929 into develop Oct 5, 2018
@jaller94 jaller94 deleted the hs/perissology/slack-events branch March 20, 2020 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants