projects
/
twirssi-net-twitter-lite.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
don't delay and format error messages, just print them
[twirssi-net-twitter-lite.git]
/
twirssi.pl
diff --git
a/twirssi.pl
b/twirssi.pl
index b00fe807628e6d0c6e0e9ba664c8baf29d430da4..acb469c1185caa3e9639a3aebfcea00e497e9722 100644
(file)
--- a/
twirssi.pl
+++ b/
twirssi.pl
@@
-11,8
+11,8
@@
$Data::Dumper::Indent = 1;
use vars qw($VERSION %IRSSI);
use vars qw($VERSION %IRSSI);
-$VERSION = "1.7.
5
";
-my ($REV) = '$Rev: 37
4
$' =~ /(\d+)/;
+$VERSION = "1.7.
6
";
+my ($REV) = '$Rev: 37
9
$' =~ /(\d+)/;
%IRSSI = (
authors => 'Dan Boger',
contact => 'zigdon@gmail.com',
%IRSSI = (
authors => 'Dan Boger',
contact => 'zigdon@gmail.com',
@@
-21,7
+21,7
@@
my ($REV) = '$Rev: 374 $' =~ /(\d+)/;
. 'Can optionally set your bitlbee /away message to same',
license => 'GNU GPL v2',
url => 'http://tinyurl.com/twirssi',
. 'Can optionally set your bitlbee /away message to same',
license => 'GNU GPL v2',
url => 'http://tinyurl.com/twirssi',
- changed => '$Date: 2009-01-
19 23:31:12 -0800 (Mon, 19
Jan 2009) $',
+ changed => '$Date: 2009-01-
21 09:50:42 -0800 (Wed, 21
Jan 2009) $',
);
my $window;
);
my $window;
@@
-734,14
+734,11
@@
sub monitor_child {
}
if ( $meta{type} eq 'tweet' ) {
}
if ( $meta{type} eq 'tweet' ) {
- $window->printformat(MSGLEVEL_PUBLIC, 'twirssi_tweet',
- $account, $meta{nick}, $marker, $_);
+ push @lines, [$meta{type}, $account, $meta{nick}, $marker, $_];
} elsif ( $meta{type} eq 'reply' ) {
} elsif ( $meta{type} eq 'reply' ) {
- $window->printformat(MSGLEVEL_PUBLIC, 'twirssi_reply',
- $account, $meta{nick}, $marker, $_);
+ push @lines, [$meta{type}, $account, $meta{nick}, $marker, $_];
} elsif ( $meta{type} eq 'dm' ) {
} elsif ( $meta{type} eq 'dm' ) {
- $window->printformat(MSGLEVEL_PUBLIC, 'twirssi_dm',
- $account, $meta{nick}, $_);
+ push @lines, [$meta{type}, $account, $meta{nick}, $_];
} elsif ( $meta{type} eq 'error' ) {
$window->print("ERROR: $_", MSGLEVEL_PUBLIC);
} elsif ( $meta{type} eq 'debug' ) {
} elsif ( $meta{type} eq 'error' ) {
$window->print("ERROR: $_", MSGLEVEL_PUBLIC);
} elsif ( $meta{type} eq 'debug' ) {
@@
-763,6
+760,10
@@
sub monitor_child {
if ($new_last_poll) {
print "new last_poll = $new_last_poll" if &debug;
if ($new_last_poll) {
print "new last_poll = $new_last_poll" if &debug;
+ for my $line ( @lines ) {
+ $window->printformat(MSGLEVEL_PUBLIC, "twirssi_".@$line[0],
+ @$line[1,2,3,4]);
+ }
close FILE;
unlink $filename
close FILE;
unlink $filename
@@
-875,7
+876,9
@@
sub sig_complete {
and $linestart =~ /^\/reply(?:_as)?\s*$/ )
)
{ # /twitter_reply gets a nick:num
and $linestart =~ /^\/reply(?:_as)?\s*$/ )
)
{ # /twitter_reply gets a nick:num
- @$complist = grep /^\Q$word/i, sort keys %{ $id_map{__indexes} };
+ $word =~ s/^@//;
+ @$complist = map { "$_:$id_map{__indexes}{$_}" } grep /^\Q$word/i,
+ sort keys %{ $id_map{__indexes} };
}
# /tweet, /tweet_as, /dm, /dm_as - complete @nicks (and nicks as the first
}
# /tweet, /tweet_as, /dm, /dm_as - complete @nicks (and nicks as the first
@@
-929,6
+932,11
@@
Irssi::settings_add_bool( "twirssi", "twirssi_use_reply_aliases", 0 );
Irssi::settings_add_bool( "twirssi", "tweet_window_input", 0 );
$window = Irssi::window_find_name( Irssi::settings_get_str('twitter_window') );
Irssi::settings_add_bool( "twirssi", "tweet_window_input", 0 );
$window = Irssi::window_find_name( Irssi::settings_get_str('twitter_window') );
+if (!$window) {
+ $window = Irssi::Windowitem::window_create (Irssi::settings_get_str('twitter_window'), 1);
+ $window->set_name (Irssi::settings_get_str('twitter_window'));
+}
+
if ($window) {
Irssi::command_bind( "dm", "cmd_direct" );
Irssi::command_bind( "dm_as", "cmd_direct_as" );
if ($window) {
Irssi::command_bind( "dm", "cmd_direct" );
Irssi::command_bind( "dm_as", "cmd_direct_as" );