Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaner implementation #21

Merged
merged 2 commits into from
Dec 10, 2015
Merged

Cleaner implementation #21

merged 2 commits into from
Dec 10, 2015

Conversation

apanzerj
Copy link
Collaborator

I kept finding myself needing more and more of the raw information from the Flowdock API. Instead adding those as attributes that get evaluated by the message_handler (and thus making things waaay more complicated) this seemed like the better approach.

Let's store the data (the hash for the incoming event) in the FlowdockMessage object. Then we can add methods to the message so that we can interrogate the message inside other addons.

This creates three useful methods:

FlowdockMessage#tags returns data['tags']

FlowdockMessage#thread_id returns data['thread_id']

FlowdockMessage#new_thread? returns data['id'] == data['thread']['initial_message']

If we wanted to add other methods we could do so easily.

Thoughts @bhouse

@bhouse
Copy link
Owner

bhouse commented Dec 10, 2015

looks good, thanks @apanzerj! 👍

bhouse added a commit that referenced this pull request Dec 10, 2015
@bhouse bhouse merged commit 7279d30 into master Dec 10, 2015
@bhouse bhouse deleted the apanzerj/is_new_thread branch December 10, 2015 20:12
@bhouse
Copy link
Owner

bhouse commented Dec 10, 2015

released in v0.3.0

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

Successfully merging this pull request may close these issues.

None yet

2 participants