I have been working on a Gitter integration for Discourse as an alternative service to the Slack plugin and I’d like to share the current state of it.
It’s necessary to create a custom integration in each room in which we want Discourse notifications. Once created, go to /admin/plugins/gitter to register a new integration with the room name (e.g. gitterhq/meta) and the integration webhook url.
As you can see below, the admin interface is pretty similar to the Slack plugin’s, allowing to create filter rules specifying a category and some tags(optional). The main difference is that the filter rules are grouped by room.
Then, when a new post is created it will be notified in the corresponding Gitter rooms’ activity feed. The notifications follow a simple structure (username - topic title - category) due to the size of the activity feed. In addition, the whole notification text will be a link to the post in Discourse.
Create a PR to the Gitter services library. This will allow us to have an official Discourse integration in Gitter (and stop using a “custom” one) and to perform some customization to the notifications, like setting an icon.
Slash commands to manage filter rules from a Gitter room.
In addition, I consider important to mention that the idea is that, in the near future, this plugin makes use of the common event system @david is working on.
This looks great! I quite like the way Gitter has the activity stream separate from the message history.
This is definitely a lot clearer than having everything in one list. I will see if I can get something similar in the discourse-chat-integration plugin.
This confirms my fear expectation that some integration providers are going to require more than a simple “string” to define a channel. I will work out a way that discourse-chat-integration can allow different providers to specify “channels” in different ways .
Sorry for the late response @rriemann. The plugin is pretty much production ready! I’m currently working on its refactorization into the discourse-chat-integration. The inclusion of the Gitter bot might take a little bit longer since the way it is implemented differs from how the other providers implement slash commands and post transcripts.
Unfortunately, I’m not being able to find time to keep working on the Gitter integration’s development at most for a couple of months more. Here is an update of the current state of the plugin.
The other two features Slash Commands and Transcripts are still to be refactored, but that will happen after having handled a few potential issues found. Those are consequence of the way the Gitter integration implements Slash Commands (due to the lack of an official API for that) which is through a long-running thread to listen to a room’s messages. The issues are:
In multi-site installations where multiple discourse sites share the same server process only one of the threads is going to start.
In the case of a distributed Discourse forum, a new thread would be created in each server, so one forum is gonna end up with multiple connections to Gitter.
The considered approach for handling them involves creating a rake task and using a template like