Skip to content

Commit

Permalink
Touchups
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed Oct 5, 2018
1 parent d1a5cbf commit 87c6dad
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ and bot users. This allows you to link as many channels as you would like with o
1. Create a Matrix room in the usual manner for your client. Take a note of its
Matrix room ID - it will look something like `!aBcDeF:example.com`.
2. invite the bot user to the Slack channel you would like to bridge.
2. Invite the bot user to the Slack channel you would like to bridge.
```
/invite @bot-user-name
Expand All @@ -157,7 +157,7 @@ and bot users. This allows you to link as many channels as you would like with o
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
3. Issue a ``link`` command in the administration control room with these
collected values as arguments:
with file bridging:
Expand Down
4 changes: 2 additions & 2 deletions lib/AdminCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ adminCommands.link = new AdminCommand({
required: true,
},
webhook_url: {
description: "Slack webhook URL. Used with slack outgoing hooks integration",
description: "Slack webhook URL. Used with Slack outgoing hooks integration",
aliases: ['u'],
},
slack_bot_token: {
description: "Slack bot user token. Used with slack bot user & Events api",
description: "Slack bot user token. Used with Slack bot user & Events api",
aliases: ['t'],
},
slack_user_token: {
Expand Down
2 changes: 1 addition & 1 deletion lib/BaseSlackHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const log = require("matrix-appservice-bridge").Logging.get("BaseSlackHandler");
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>
// (if the message is an emote, the format is <@ID|nick>, but in normal msgs it's just <@ID>
const USER_ID_REGEX = /<@(\w+)\|?\w*?>/g;
const USER_ID_REGEX_FIRST = /<@(\w+)\|?\w*?>/;

Expand Down
7 changes: 3 additions & 4 deletions lib/BridgedRoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@ BridgedRoom.prototype._handleSlackMessage = function(message, ghost) {
);
}
let content_uri = "";
return ghost.uploadContentFromURI(file, file.url_private, this._slack_bot_token).then((file_content_uri) => {
return ghost.uploadContentFromURI(file, file.url_private, this._slack_bot_token)
.then((file_content_uri) => {
content_uri = file_content_uri;
return thumbnail_promise;
}).then((thumb_content_uri) => {
Expand All @@ -297,9 +298,7 @@ BridgedRoom.prototype._handleSlackMessage = function(message, ghost) {
// so we just send a separate `m.image` and `m.text` message
// See https://github.com/matrix-org/matrix-doc/issues/906
if (message.text) {
var text = substitutions.slackToMatrix(
message.text
);
const text = substitutions.slackToMatrix(message.text);
return ghost.sendText(roomID, text);
}
});
Expand Down

0 comments on commit 87c6dad

Please sign in to comment.