Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > by-pkgid > b18cfe3238d7eaea0bdcd5e1336d6792 > files > 3

jircii-44-0.0.1mdv2009.0.src.rpm

#
# flash.irc - gets your attention when something happens...
#  

#                        blue                 green              red
@FLASH_COLORS  = array(getMappedColor(12), getMappedColor(3), getMappedColor(4));

$FLASH_CURRENT = -1; # no flash is currently happening

on public
{
   if ($me isin $1-) 
   { 
      flashTab(1); 
   }
}

on msg
{
   flashTab(1);
}

on signon
{
   flashTab(0);
}

on kick
{
   if ($1 eq $me)
   {
      flashTab(2);
   }
}

sub flashTab
{
   if (getSessionId() != getActiveSessionId() && $TAB_COLOR == $null && $FLASH_CURRENT <= $1)
   {
      $TAB_COLOR     = getSessionColor();
      $FLASH_CURRENT = $1;
      $X = 0;

      sub tabtemp
      {
         if (($X % 2) == 0)
         {
            setSessionColor(@FLASH_COLORS[$FLASH_CURRENT]);
         }
         else
         {
            setSessionColor($TAB_COLOR);
         }

         $X++;

         if (getSessionId() == getActiveSessionId())
         {
            stopTimer($TAB_TIMER);
            setSessionColor($TAB_COLOR);
            $FLASH_CURRENT = -1;
            $TAB_COLOR     = $null;
         }
      }

      $TAB_TIMER = addTimer(&tabtemp, 500);
   }
}