diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-02-16 22:34:35 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-02-16 22:58:00 -0600 |
commit | 2f7b660dd95086ebf68de8a795fa4abd643f33e2 (patch) | |
tree | 720f295f6e7bdc048dc2558cbc8ade8092bfb4f3 | |
parent | 3ac0b0907a892c9db38c398d5a53ad0c47088666 (diff) | |
download | bot-flowdock-irc-2f7b660dd95086ebf68de8a795fa4abd643f33e2.tar.gz bot-flowdock-irc-2f7b660dd95086ebf68de8a795fa4abd643f33e2.zip |
start refactoring to be able to handle timeline stuff
-rw-r--r-- | lib/Bot/Flowdock/IRC.pm | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/lib/Bot/Flowdock/IRC.pm b/lib/Bot/Flowdock/IRC.pm index 0f725c7..878e235 100644 --- a/lib/Bot/Flowdock/IRC.pm +++ b/lib/Bot/Flowdock/IRC.pm @@ -116,22 +116,31 @@ sub tick { next if $event->{user} == $self->_my_id; + my $app = $event->{app} || ''; my $type = $event->{event}; - if ($type eq 'message' || $type eq 'line') { - $self->flowdock_message($event); + if ($app eq 'chat') { + if ($type eq 'message' || $type eq 'line') { + $self->flowdock_message($event); + } + elsif ($type eq 'status') { + $self->flowdock_status($event); + } + elsif ($type eq 'user-edit') { + $self->flowdock_user_edit($event); + } + else { + warn "Unknown chat event type $type: " . encode_json($event); + } } - elsif ($type eq 'status') { - $self->flowdock_status($event); - } - elsif ($type eq 'user-edit') { - $self->flowdock_user_edit($event); - } - elsif ($type eq 'activity.user') { - # ignore it + elsif ($app eq 'influx') { # i think this is timeline stuff + # ... } else { - warn "Unknown event type $type: " . encode_json($event); + # we don't care activity events + if ($type ne 'activity.user') { + warn "Unknown event type $type for unknown app $app: " . encode_json($event); + } } } |