# Common event system for chatrooms - a specification

**URL:** <https://meta.discourse.org/t/common-event-system-for-chatrooms-a-specification/59245>\
**Category:** Feature\
**Created:** [March 16, 2017, 1:01pm UTC](https://meta.discourse.org/t/common-event-system-for-chatrooms-a-specification/59245 "2017-03-16T13:01:04Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)\
**Post date:** [March 16, 2017, 9:05pm UTC](https://meta.discourse.org/t/common-event-system-for-chatrooms-a-specification/59245/7 "2017-03-16T21:05:50Z")

</div>

> [@sam](#):
>
> Why does core need to worry about this stuff?

> [@eviltrout](#):
>
> Something like discourse-chat for core support, and then discourse-chat-slack, discourse-chat-hipchat for adapters.

Yep, I think this is probably plugin material, and that naming system sounds ideal.

> [@sam](#):
>
> Isn’t a simpler way of going about this simply renaming “slack plugin” to “chat integration plugin” and adding extra providers for other chat platforms?

That is effectively what I’m thinking of, but rather than just adding it all into one plugin I think a more modular approach would be better. The starting point of any work would most definitely be the current slack plugin.

> [@Falco](#):
>
> Also I’m not sure about making this available to every user vs only admins.

I guess this entirely depends on the direction you want to take any chat integrations. Is it a tool for the people running the forum to use for admin/moderation, or is it a way for members to keep up-to-date with what’s going on?

Taking meta as an example, if `@team` wanted to get new #Contribute > Bug posts in their slack chat, they could do that nice and easily. However, if I (as a regular user) wanted to get Telegram notifications about new plugins, there’s no way of doing it.

Sure, starting out with it only being for admins is a sensible roadmap, but I really think this would be useful for many users - it would certainly be used on the community I manage.

> [@eviltrout](#):
>
> The core plugin would attach to existing events in the site and expose others, like: DiscourseEvent.trigger(:notify\_chat, msg) where msg would be an object full of things we can expose to chat providers.

I don’t fully understand this. If you’re not envisioning any kind of “subscription” model in the common event system, then why is there a need for a separate “notify chat” event, when chat plugins can quite easily attach to a `:post_created` event?

* * *
[quote="eviltrout, post:6, topic:59245"] it's above and beyond what I had in mind. When in doubt I like to keep things simple and build up [/quote] I get this, starting simple is definitely better. I've kind of viewed the discourse-slack plugin as a starting point, which might be why I've gone too far. 

Ultimately what I think it all comes down to is who is this feature for, and what’s its use case? I’ve been thinking of it as another way for users to receive updates, whereas I think you’re thinking about it as an admin/mod tool?

---

_[View the full topic](https://meta.discourse.org/t/common-event-system-for-chatrooms-a-specification/59245)._
