diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-02-16 21:55:50 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-02-16 22:20:38 -0600 |
commit | 147b1a95197ff89a5587c8b4c8b6bb5553de9372 (patch) | |
tree | 8371fa88cc0b2bfc254009c18beda828f3bc1b91 /lib | |
parent | 7fdb5abb8bf3850248c7e5e5c4f99dff2e8751d7 (diff) | |
download | bot-flowdock-irc-147b1a95197ff89a5587c8b4c8b6bb5553de9372.tar.gz bot-flowdock-irc-147b1a95197ff89a5587c8b4c8b6bb5553de9372.zip |
handle actions from flowdock
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Bot/Flowdock/IRC.pm | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Bot/Flowdock/IRC.pm b/lib/Bot/Flowdock/IRC.pm index d11fd13..e0e80ea 100644 --- a/lib/Bot/Flowdock/IRC.pm +++ b/lib/Bot/Flowdock/IRC.pm @@ -99,7 +99,7 @@ sub tick { my $type = $event->{event}; - if ($type eq 'message') { + if ($type eq 'message' || $type eq 'line') { $self->flowdock_message($event); } elsif ($type eq 'user-edit') { @@ -124,7 +124,10 @@ sub flowdock_message { return if exists $event->{external_user_name}; my $name = $self->name_from_id($event->{user}); - $self->_say_to_channel($event->{content}, $name); + $self->_say_to_channel( + $event->{content}, $name, + emoted => ($event->{event} eq 'line') + ); } sub flowdock_user_edit { @@ -179,12 +182,13 @@ sub nick_change { sub _say_to_channel { my $self = shift; - my ($body, $from) = @_; + my ($body, $from, %params) = @_; if (defined($from)) { + $body = $params{emoted} ? "* $from $body" : "<$from> $body"; $self->say( channel => ($self->channels)[0], - body => "<$from> $body", + body => $body, ); } else { |