/[meteor]/googlecode.com/svn/trunk/Meteor/Channel.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /googlecode.com/svn/trunk/Meteor/Channel.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 52 by andrew.betts, Wed Feb 27 13:55:35 2008 UTC revision 53 by andrew.betts, Wed Feb 27 21:58:56 2008 UTC
# Line 77  sub listChannels { Line 77  sub listChannels {
77          $list;          $list;
78  }  }
79    
 sub listChannelsUsingTemplate {  
         my $class=shift;  
         my $template=shift;  
           
         return '' unless(defined($template) && $template ne '');  
           
         my $list='';  
         foreach my $channelName (sort keys %Channels)  
         {  
                 my $channel=$Channels{$channelName};  
                   
                 $list.=$channel->descriptionWithTemplate($template);  
         }  
           
         $list;  
 }  
   
80  sub deleteChannel {  sub deleteChannel {
81          my $class=shift;          my $class=shift;
82          my $channelName=shift;          my $channelName=shift;
# Line 180  sub addSubscriber { Line 163  sub addSubscriber {
163                    
164          &::syslog('info','',          &::syslog('info','',
165                  'joinchannel',                  'joinchannel',
166                    $subscriber->{'ip'},
167                  $subscriber->{'subscriberID'},                  $subscriber->{'subscriberID'},
168                  $self->{'name'},                  $self->{'name'},
169                  $mode,                  $mode,
# Line 206  sub removeSubscriber { Line 190  sub removeSubscriber {
190                    
191          my $idx=undef;          my $idx=undef;
192          my $numsubs = scalar(@{$self->{'subscribers'}});          my $numsubs = scalar(@{$self->{'subscribers'}});
193          for(my $i=0;$i<$numsubs;$i++)  
194          {          for (my $i=0; $i<$numsubs; $i++) {
195                  if($self->{'subscribers'}->[$i]==$subscriber)                  if($self->{'subscribers'}->[$i]==$subscriber) {
                 {  
196                          $idx=$i;                          $idx=$i;
197                          last;                          last;
198                  }                  }
# Line 222  sub removeSubscriber { Line 205  sub removeSubscriber {
205                  my $timeConnected = time - $subscriber->{'ConnectionStart'};                  my $timeConnected = time - $subscriber->{'ConnectionStart'};
206                  &::syslog('info','',                  &::syslog('info','',
207                          'leavechannel',                          'leavechannel',
208                            $subscriber->{'ip'},
209                          $subscriber->{'subscriberID'},                          $subscriber->{'subscriberID'},
210                          $self->{'name'},                          $self->{'name'},
211                          $timeConnected,                          $timeConnected,
# Line 365  sub descriptionWithTemplate { Line 349  sub descriptionWithTemplate {
349          my $self=shift;          my $self=shift;
350          my $template=shift;          my $template=shift;
351                    
352            return '' unless(defined($template) && $template ne '');
353            
354          $template=~s/~([a-zA-Z0-9_]*)~/          $template=~s/~([a-zA-Z0-9_]*)~/
355                  if(!defined($1) || $1 eq '') {                  if(!defined($1) || $1 eq '') {
356                          '~';                          '~';
# Line 373  sub descriptionWithTemplate { Line 359  sub descriptionWithTemplate {
359                  } elsif($1 eq 'subscriberCount') {                  } elsif($1 eq 'subscriberCount') {
360                          $self->subscriberCount();                          $self->subscriberCount();
361                  } elsif($1 eq 'lastMsgID') {                  } elsif($1 eq 'lastMsgID') {
362                          $self->lastMsgID();                          $self->lastMsgID() || 0;
363                  } elsif($1 eq 'name') {                  } elsif($1 eq 'name') {
364                          $self->{'name'};                          $self->{'name'};
365                  } else {                  } else {

Legend:
Removed from v.52  
changed lines
  Added in v.53

  ViewVC Help
Powered by ViewVC 1.1.26