jafeth.diazc has developed a Gitter integration plugin for Discourse, an alternative to the Slack plugin. The plugin allows creating filter rules by room, specifying a category and optional tags. It also supports slash commands for managing filter rules from a Gitter room.
To use the plugin, users need to create a custom integration in each Gitter room and register it in the Discourse admin interface. Notifications are then sent to the corresponding Gitter rooms’ activity feed.
The plugin is mostly production-ready, but some features, such as slash commands and transcripts, still need to be refactored into the discourse-chat-integration plugin. jafeth.diazc is currently working on this, but expects to be unable to continue development for a couple of months.
Notable features and plans include:
Slash Commands: jafeth.diazc has implemented slash commands, allowing users to manage filter rules from a Gitter room.
Refactoring: The plugin is being refactored into the discourse-chat-integration plugin, with notifications already integrated jafeth.diazc.
Potential Issues: jafeth.diazc has identified issues with multi-site installations and distributed Discourse forums, and plans to address them using a rake task and polling demon.
david has offered to help adjust the chat-integration structure to accommodate the Gitter bot’s implementation.
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
to run the rake task as a polling demon for Gitter.
Finally, if any questions, I’d happily answer them asap