diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-02-16 20:45:26 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-02-16 21:05:44 -0600 |
commit | 9dccd541a5d22a3418da6084d76ca4cab98c6f59 (patch) | |
tree | f44ffcf04d59b8f5550c67f607ae3a3132c9ce4f /lib/Bot | |
parent | e903d6bdaec97dbbd61e9165513e85ad75593e02 (diff) | |
download | bot-flowdock-irc-9dccd541a5d22a3418da6084d76ca4cab98c6f59.tar.gz bot-flowdock-irc-9dccd541a5d22a3418da6084d76ca4cab98c6f59.zip |
differentiate actions from messages
ugly for now, because the api only allows external users to post
messages at the moment
Diffstat (limited to 'lib/Bot')
-rw-r--r-- | lib/Bot/Flowdock/IRC.pm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Bot/Flowdock/IRC.pm b/lib/Bot/Flowdock/IRC.pm index 76cfdb9..bd0a8c3 100644 --- a/lib/Bot/Flowdock/IRC.pm +++ b/lib/Bot/Flowdock/IRC.pm @@ -131,6 +131,10 @@ sub said { # poco::irc at some point. my $msg = ($address ? "$address: " : '') . $args->{body}; + # XXX when they allow external users to post status update events, fix this + $msg = '*' . $msg . '*' + if $args->{emoted}; + $self->flowdock_api->push_chat({ external_user_name => $args->{who}, content => $msg, @@ -139,6 +143,14 @@ sub said { return; } +around emoted => sub { + my $orig = shift; + my $self = shift; + my ($args) = @_; + $args->{emoted} = 1; + return $self->$orig($args); +}; + __PACKAGE__->meta->make_immutable; no Moose; |