From bb8543cdff7e66e72e623c0bc4eb39742f8fe714 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Thu, 18 Oct 2018 13:00:47 -0600 Subject: [PATCH 1/4] Better to leave the text un-modified if we dont understand the emoji Signed-off-by: Stuart Mumford --- lib/substitutions.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/substitutions.js b/lib/substitutions.js index 45f32a68..b3ba4600 100644 --- a/lib/substitutions.js +++ b/lib/substitutions.js @@ -91,6 +91,9 @@ var slackToMatrix = function(body, file) { if (emojiChar !== undefined) { return emojiChar; } + else { + return emojiKey; + } log.warn("Failed to recognise emoji sequence: " + emojiKey); }); return body; From 965df46bc714991bd3849987c1007c18fa389000 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Thu, 18 Oct 2018 13:22:31 -0600 Subject: [PATCH 2/4] fix the fix for emoji subs Signed-off-by: Stuart Mumford --- lib/substitutions.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/substitutions.js b/lib/substitutions.js index b3ba4600..fca1f4bf 100644 --- a/lib/substitutions.js +++ b/lib/substitutions.js @@ -91,10 +91,8 @@ var slackToMatrix = function(body, file) { if (emojiChar !== undefined) { return emojiChar; } - else { - return emojiKey; - } log.warn("Failed to recognise emoji sequence: " + emojiKey); + return emojiKey; }); return body; }; From e83a8e2481e2a26b0629908ce273a67f01cceb87 Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Fri, 19 Oct 2018 13:20:43 +0100 Subject: [PATCH 3/4] s/messages/message --- lib/SlackHookHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/SlackHookHandler.js b/lib/SlackHookHandler.js index be18f409..1f8c057c 100644 --- a/lib/SlackHookHandler.js +++ b/lib/SlackHookHandler.js @@ -369,7 +369,7 @@ SlackHookHandler.prototype.lookupMessage = function(channelID, timestamp, token) var message = response.messages[0]; log.debug("Looked up message from history as " + JSON.stringify(message)); - if (messages.subtype !== "file_share") { + if (message.subtype !== "file_share") { return message; } return this.enablePublicSharing(message.file, token) From c4395416c3d9e2adc113ecae5bd4cae1c6841de7 Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Sat, 20 Oct 2018 12:58:25 +0100 Subject: [PATCH 4/4] Fixes #107 --- lib/Main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Main.js b/lib/Main.js index 9abb5757..a50f61e7 100644 --- a/lib/Main.js +++ b/lib/Main.js @@ -853,7 +853,7 @@ Provisioning.commands.logout = new Provisioning.Command({ return; } const store = main._bridge.getUserStore(); - return store.getMatrixUser(userId).then((matrixUser) => { + return store.getMatrixUser(user_id).then((matrixUser) => { matrixUser = matrixUser ? matrixUser : new BridgeLib.MatrixUser(userId); const accounts = matrixUser.get("accounts") || {}; delete accounts[slack_id];