use vars qw($VERSION %IRSSI);
$VERSION = "2.0.5";
-my ($REV) = '$Rev: 480 $' =~ /(\d+)/;
+my ($REV) = '$Rev: 481 $' =~ /(\d+)/;
%IRSSI = (
authors => 'Dan Boger',
contact => 'zigdon@gmail.com',
. 'Can optionally set your bitlbee /away message to same',
license => 'GNU GPL v2',
url => 'http://twirssi.com',
- changed => '$Date: 2009-02-18 13:41:52 -0800 (Wed, 18 Feb 2009) $',
+ changed => '$Date: 2009-02-19 14:22:45 -0800 (Thu, 19 Feb 2009) $',
);
my $window;
return unless &valid_username($username);
eval {
- unless ( $twits{$username}
+ if ( $twits{$username}
->new_direct_message( { user => $target, text => $text } ) )
{
+ ¬ice("DM sent to $target");
+ $nicks{$target} = time;
+ } else {
+ my $error;
+ eval {
+ $error = JSON::Any->jsonToObj( $twits{$username}->get_error() );
+ $error = $error->{error};
+ };
+ die $error if $error;
¬ice("DM to $target failed");
- return;
}
};
if ($@) {
- ¬ice("DM caused an error: $@. Aborted");
+ ¬ice("DM caused an error: $@");
return;
- } else {
- ¬ice("DM sent to $target");
- $nicks{$target} = time;
}
}
return if &too_long($data);
+ my $success = 1;
eval {
unless ( $twits{$username}->update($data) )
{
¬ice("Update failed");
- return;
+ $success = 0;
}
};
+ return unless $success;
if ($@) {
- ¬ice("Update caused an error. Aborted.");
+ ¬ice("Update caused an error: $@. Aborted.");
return;
}
return if &too_long($data);
+ my $success = 1;
eval {
unless (
$twits{$username}->update(
)
{
¬ice("Update failed");
- return;
+ $success = 0;
}
};
+ return unless $success;
if ($@) {
- ¬ice("Update caused an error. Aborted");
+ ¬ice("Update caused an error: $@. Aborted");
return;
}
return;
}
+ my $success = 1;
eval {
unless ( $twit->$api_name($data) )
{
¬ice("$api_name failed");
- return;
+ $success = 0;
}
};
+ return unless $success;
if ($@) {
¬ice("$api_name caused an error. Aborted.");
};
if ($@) {
- print $fh "type:debug Error during friends_timeline call. Aborted.\n";
+ print $fh
+ "type:debug Error during friends_timeline call: $@. Aborted.\n";
return 1;
}