r615 - Release v2.2.2
[twirssi-net-twitter-lite.git] / twirssi.pl
index 2375ba9b0504299f51079c357904c6b5d900155b..0dd07ca1a8d31cdc368085a47464b65a171b4c65 100644 (file)
@@ -10,8 +10,8 @@ $Data::Dumper::Indent = 1;
 
 use vars qw($VERSION %IRSSI);
 
-$VERSION = "2.2.1beta";
-my ($REV) = '$Rev: 607 $' =~ /(\d+)/;
+$VERSION = "2.2.2";
+my ($REV) = '$Rev: 615 $' =~ /(\d+)/;
 %IRSSI = (
     authors     => 'Dan Boger',
     contact     => 'zigdon@gmail.com',
@@ -20,7 +20,7 @@ my ($REV) = '$Rev: 607 $' =~ /(\d+)/;
       . 'Can optionally set your bitlbee /away message to same',
     license => 'GNU GPL v2',
     url     => 'http://twirssi.com',
-    changed => '$Date: 2009-04-09 21:22:55 -0700 (Thu, 09 Apr 2009) $',
+    changed => '$Date: 2009-04-20 20:26:08 -0700 (Mon, 20 Apr 2009) $',
 );
 
 my $window;
@@ -552,12 +552,12 @@ sub cmd_add_search {
         return;
     }
 
-    if ( exists $id_map{__searches}{$user}{$data} ) {
+    if ( exists $id_map{__searches}{"$user\@$defservice"}{$data} ) {
         &notice("Already had a subscription for '$data'");
         return;
     }
 
-    $id_map{__searches}{$user}{$data} = 1;
+    $id_map{__searches}{"$user\@$defservice"}{$data} = 1;
     &notice("Added subscription for '$data'");
 }
 
@@ -577,12 +577,12 @@ sub cmd_del_search {
         return;
     }
 
-    unless ( exists $id_map{__searches}{$user}{$data} ) {
+    unless ( exists $id_map{__searches}{"$user\@$defservice"}{$data} ) {
         &notice("No subscription found for '$data'");
         return;
     }
 
-    delete $id_map{__searches}{$user}{$data};
+    delete $id_map{__searches}{"$user\@$defservice"}{$data};
     &notice("Removed subscription for '$data'");
 }
 
@@ -810,8 +810,7 @@ sub do_updates {
     eval {
         if ( $id_map{__last_id}{$username}{timeline} )
         {
-            $tweets = $obj->friends_timeline(
-                { since_id => $id_map{__last_id}{$username}{timeline} } );
+            $tweets = $obj->friends_timeline( { count => 100 } );
         } else {
             $tweets = $obj->friends_timeline();
         }
@@ -1311,6 +1310,13 @@ sub sig_complete {
           keys %{ $id_map{__indexes} };
     }
 
+    if ( $linestart =~ /^\/twitter_unfriend\s*$/ )
+    {    # /twitter_unfriend gets a nick
+        $word =~ s/^@//;
+        push @$complist, grep /^\Q$word/i,
+          sort { $nicks{$b} <=> $nicks{$a} } keys %nicks;
+    }
+
     # /tweet, /tweet_as, /dm, /dm_as - complete @nicks (and nicks as the first
     # arg to dm)
     if ( $linestart =~ /^\/(?:tweet|dm)/ ) {