I consider my Slack/IRC gateway the best one out there, at least in terms of looking the most native to IRC users. We use this to connect the #indieweb IRC channel with our Slack team, so people can join the same rooms from either Slack or IRC. Often times people don't even realize that other users in IRC are actually connected via the Slack bridge! However, one glaring missing feature was that image uploads from Slack did not come through right. Today, I fixed that!
Now when you upload an image in Slack, it is converted to a message in IRC that should look "normal" to IRC users, as if the person had shared the image in IRC directly.
There are a few different ways images can be sent in Slack. When you upload an image, Slack provides fields for setting the image title (defaults to the filename), as well as adding a comment.
Here are the various combinations of ways images appear in Slack compared to how the gateway translates them to IRC.
In this case, only a URL is sent in IRC, since it includes the filename at the end of the URL, which is typically what people in IRC are accustomed to seeing when people link to images. The image URL I actually ended up with from Slack ended with the "pub_secret" parameter, so I tacked on the filename at the end in order to both look better for people reading it, as well as to get IRC clients to recognize the image file extension and inline the image.
In Slack, sometimes people include unique text in the image title which becomes part of the message they are sending.
In this case, the gateway includes the text they typed as the first part of the message in IRC, in order to approximate how it appears in Slack where the image title appears first.
If you include a comment in the image upload screen, it appears below the image in Slack. Note that in this example I did not change the title of the file.
In this case, the message in IRC starts with the URL and includes the comment at the end of the line. (Also notice the emoji shows up properly!)
The last combination is possible when the user both sets a custom title and includes a comment.
Combining both previous examples, this includes the image title first, followed by the image URL, followed by the comment.
Happy image uploading!
When someone types an emoji in Slack, it shows up in the API as a text description surrounded by colons. For example, 😻 is
:heart_eyes_cat: when it comes through the API. Previously, the gateway would just send the text through to IRC, which doesn't look great for IRC users.
Today I updated the gateway to translate those emoji text to unicode so that they appear as native emoji in IRC.
It was actually a surprisingly small amount of code overall. Thankfully, Slack publishes the data they use for their emoji names, so I basically added that to the gateway and look up the mapping there. I had to use a separate library to translate the unicode hex values to an actual unicode string.
It even supports the emoji with skin tone variations! 👍🏻👍🏿
For now, I just left the custom emoji unreplaced, since they are images in Slack and there isn't a good way to send image data in IRC. For our web logs, I might in the future replace those with images so that they look right there, but for now just getting the standard emoji replaced is an improvement for our IRC channel as well as the web logs!
For quite some time, we've been running my IRC/Slack gateway so that our main #indieweb IRC channel is also available in Slack. It's great because it allows people to use the nice mobile-friendly Slack client, while also not locking ourselves into a proprietary platform. The bridge is also used to allow people to join the chat from our web interface.
Prior to the previous IndieWeb Summit (now over 6 months ago!), we only had one IRC channel. At the Summit, we decided to start using more channels to help keep technical discussions separate from general and user-centric discussions. (See https://indieweb.org/discuss for more details). However, the bridge was written with only one IRC channel in mind so it only bridged the main channel. Lately, we've had more people joining the Slack instance and it's started to cause fragmented discussions.
Today I updated the Slack gateway to be able to support multiple IRC/Slack channels!
You can define multiple pairs of channels in the config file, so that the gateway knows which Slack channels correspond with which IRC channels. When a message is received in Slack, a new IRC user joins all the defined rooms and the messages are routed appropriately.
This is live today, and is now bridging the following rooms:
We have public logs for all the channels except for #indieweb-chat. We've intentionally always had an un-logged channel available for off-topic chatter. That channel has been called #indiechat. Even though we don't have a paid Slack account so the channel history is limited to 10,000 across all channels, I wasn't comfortable bridging the #indiechat room to Slack since it has traditionally been ephemeral, and sending it to Slack means that visibility would change a little. So instead, I used the under-consideration #indieweb-chat channel to connect with Slack since people weren't using that very much on IRC yet anyway.