Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Pass all events to handlers vs noop #111

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rposborne
Copy link
Contributor

The intent of this pull request is to allow handlers to be able to observe other events such as presence_change. This changes the default behavior of sending unhandled events to a NOOP instead to be a simple passthrough. The entire payload of the event is passed on to the event with no maniuplation.

Possible further steps are to check for standard hash keys and convert them to Lita::User and Lita::Room.

@dmann
Copy link

dmann commented Dec 2, 2016

This is great! I'd like to see this expanded to include the 20+ message sub_types that are currently being ignored. Maybe by changing:

        def handle_message
          return unless supported_subtype?

to

        def handle_message
          return handle_unknown unless supported_subtype?

Though, the triggered event would be named :slack_message, so maybe included the sub_type in the event name would be in order. If my suggestions are off topic, I'll gladly submit a separate pull request when this one is accepted and merged in.

@rposborne
Copy link
Contributor Author

@dmann I think breaking subtypes out might be best as an additional refactor.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants