42wim / matterbridge

bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API (mattermost not required!)
Apache License 2.0
6.61k stars 616 forks source link

Use attachments to compensate for lack of reaction emoji across Slack bridges #526

Open patcon opened 6 years ago

patcon commented 6 years ago

This is a stretch, but I'm just thinking on how to use the existing feature sets to work around API and permissions limitations.

Attachments can be updated after the fact: https://api.slack.com/methods/chat.postMessage

Attachments can be very subtle and small, when configured correctly. You can experiment here: https://api.slack.com/docs/messages/builder

I wonder if the attachment could be used to build a little representation of the emoji counts across Slacks...

patcon commented 5 years ago

Been thinking on this one. Here's a little demo of all the appropriate formatting we could get:

screen shot 2018-10-26 at 11 24 04 pm

Playable demo

Was trying to find a combination of brackets and spaces and numbers that made this look like buttons, but without the confusion of actually being clickable. A handy list of bracket types.

patcon commented 5 years ago

My two favourites, but I think I like the small ones that only use the footer key most

footer

screen shot 2018-10-26 at 11 31 35 pm

actions buttons

screen shot 2018-10-26 at 11 30 52 pm

patcon commented 5 years ago

So here's my thinking:

pros: can see reactions across bridges. no need to visit other channel/team to see how people respond. (I'm finding this desire to see responses is felt very strongly -- Since my bridged channels are on the same slace doing translation between channels, I can easily visit other channels to see if an idea resonated. Seems bad that most people lose this feedback.)

cons: still can't see who left the reactions. slight duplication in UI.

Alternatives: could avoid showing on the reaction-giving end, and so users could just tally up the totals. But I think this will confuse people who see two different numbers. not everyone even know about the bridge. but with the sum method, then as soon as they leave their first reaction, they see the attachment increment, and they understand what's happening.

patcon commented 5 years ago

Another con: people could vote on each bridge, to get as many votes as bridges, and this might not be apparent. For example, when emoji used to vote. But at least someone could investigate and see on each bridge by inspecting the actual reaction emoji widget (which shows who voted on hover)

patcon commented 5 years ago

One big con that I somehow neglected: An attachment can never be added to the original message, since it's not owned by the bot. So it will just be other places that benefit from seeing the full extent of reactions

patcon commented 5 years ago

An attachment can never be added to the original message

Just realized that, if we want, we could get around this by immediately echoing back a blank reply message with attachment (either threaded or not), which can be used as a container for emoji replies from across the gateway.

Sample

patcon commented 5 years ago

Got a simple PoC working for this, will come back to it later: https://github.com/patcon/matterbridge/compare/805d84e...526-reactions

Currently just appends emoji to end of existing messages, but should really:

  1. check to see if special reaction emoji attachment is present as first attachment on reaction target.
  2. If yes, parse it to get counts of emoji, then add the current one.
  3. If not, create and attach
  4. post update to message, updating attachment
patcon commented 5 years ago

Just a note that zulip also seems to support reactions: https://zulipchat.com/api/real-time-events

Divide-By-0 commented 5 months ago

Got a simple PoC working for this, will come back to it later: patcon/matterbridge@805d84e...526-reactions

Currently just appends emoji to end of existing messages, but should really:

  1. check to see if special reaction emoji attachment is present as first attachment on reaction target.
  2. If yes, parse it to get counts of emoji, then add the current one.
  3. If not, create and attach
  4. post update to message, updating attachment

This is cool! Can we enable it on slack <> discord so that reactions can be transferred between the two?