X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Fchannel.c;h=386aaa2a1ad7f5166a31490746b822356e32f56c;hp=5cd24128fe1e5449ad8ef258887ff24c80a2112d;hb=e907816380d02f913cc1f9c463f7835fc70fc0c0;hpb=b7eb5f66dc93647d502572b5289ce3c6ba129463 diff --git a/src/ngircd/channel.c b/src/ngircd/channel.c index 5cd24128..386aaa2a 100644 --- a/src/ngircd/channel.c +++ b/src/ngircd/channel.c @@ -17,7 +17,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: channel.c,v 1.36 2002/12/13 17:22:57 alex Exp $"; +static char UNUSED id[] = "$Id: channel.c,v 1.37 2002/12/14 13:21:56 alex Exp $"; #include "imp.h" #include @@ -293,14 +293,13 @@ Channel_MemberCount( CHANNEL *Chan ) GLOBAL INT -Channel_CountForUser( CHANNEL *Chan, CLIENT *Client ) +Channel_CountForUser( CLIENT *Client ) { /* Count number of channels a user is member of. */ CL2CHAN *cl2chan; INT count; - assert( Chan != NULL ); assert( Client != NULL ); count = 0; @@ -315,6 +314,25 @@ Channel_CountForUser( CHANNEL *Chan, CLIENT *Client ) } /* Channel_CountForUser */ +GLOBAL INT +Channel_PCount( VOID ) +{ + /* Count the number of persistent (mode 'P') channels */ + + CHANNEL *chan; + INT count; + + count = 0; + chan = My_Channels; + while( chan ) + { + if( strchr( chan->modes, 'P' )) count++; + chan = chan->next; + } + + return count; +} /* Channel_PCount */ + GLOBAL CHAR * Channel_Name( CHANNEL *Chan )