From 9dccd541a5d22a3418da6084d76ca4cab98c6f59 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 16 Feb 2012 20:45:26 -0600 Subject: differentiate actions from messages ugly for now, because the api only allows external users to post messages at the moment --- lib/Bot/Flowdock/IRC.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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; -- cgit v1.2.3