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

Reactions bridging #131

Merged
merged 16 commits into from
Jul 5, 2019
Merged

Reactions bridging #131

merged 16 commits into from
Jul 5, 2019

Conversation

Cadair
Copy link
Collaborator

@Cadair Cadair commented May 22, 2019

builds on #130 which builds on #129

TODO:

  • Need to use aggregations API to handle slack -> matrix reaction removal.

@Half-Shot Half-Shot self-requested a review May 29, 2019 15:37
@Cadair Cadair changed the title [WIP] Reactions bridging Reactions bridging Jun 30, 2019
@Cadair
Copy link
Collaborator Author

Cadair commented Jun 30, 2019

I am not sure I can quite get the aggregations stuff in synapse to play ball for this, but I am trying.

@Cadair
Copy link
Collaborator Author

Cadair commented Jul 3, 2019

it seems matrix -> slack reaction removal might be broken.

@Cadair
Copy link
Collaborator Author

Cadair commented Jul 4, 2019

So it seems that slack has alternative names for a bunch of emoji i.e :+1: and :thumbsup: and this works with :+1: but not :thumbsup:.

AHGHGGGGHHHHHHHLLLLLL

@Cadair
Copy link
Collaborator Author

Cadair commented Jul 4, 2019

Fixed.

@Cadair Cadair force-pushed the reactions_bridging branch 3 times, most recently from ec91cdd to 77a5ed1 Compare July 5, 2019 09:28
@Cadair
Copy link
Collaborator Author

Cadair commented Jul 5, 2019

this is now based on #153

Copy link
Contributor

@Half-Shot Half-Shot left a comment

Choose a reason for hiding this comment

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

Otherwise looks good


// TODO: This only works once from matrix as we are sending the event as the
// bot user.
var body = {channel: this._slack_channel_id,
Copy link
Contributor

Choose a reason for hiding this comment

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

VAR

return message;
}

// match all channelIds
var testForName = message.text.match(CHANNEL_ID_REGEX);
var testForName = text.match(CHANNEL_ID_REGEX);
Copy link
Contributor

Choose a reason for hiding this comment

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

VAR

@@ -190,6 +191,58 @@ BridgedRoom.prototype.toEntry = function() {
return entry;
};

BridgedRoom.prototype.onMatrixReaction = async function(message) {
if (!this._slack_bot_token) return Promise.resolve();
Copy link
Contributor

Choose a reason for hiding this comment

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

This is an async function, just return

// Then we walk that list and find the one with the sender we care about, and return that event.

// TODO: Not sure this works, having trouble testing it against a sufficiently new synapse.
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please just remove the func if it doesn't work. I'm not sure it's worth bloating the code base out with future things if the spec isn't even merged yet.

@@ -146,7 +152,7 @@ SlackEventHandler.prototype.doChannelUserReplacements = async function(msg, text
* @param {string} params.event.ts The unique (per-channel) timestamp
*/
SlackEventHandler.prototype.handleMessageEvent = async function (params) {
var room = this._main.getRoomBySlackChannelId(params.event.channel);
var room = this._main.getRoomBySlackChannelId(params.event.channel || params.event.item.channel);
Copy link
Contributor

Choose a reason for hiding this comment

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

VAR

@Half-Shot
Copy link
Contributor

FYI, we decided to not do redactions of reactions slack -> matrix because it involves having to listen for your own reactions over the events API and it can wait for a future PR.

@Half-Shot Half-Shot merged commit 79074f6 into matrix-org:develop Jul 5, 2019
@Cadair Cadair deleted the reactions_bridging branch July 5, 2019 16:14
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.

2 participants