1
0
mirror of https://github.com/osmarks/ngircd.git synced 2025-11-07 01:03:00 +00:00

- new function Channel_CountForUser().

This commit is contained in:
Alexander Barton
2002-12-13 17:22:57 +00:00
parent 427be23b6e
commit b7eb5f66dc
2 changed files with 59 additions and 34 deletions

View File

@@ -17,7 +17,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: channel.c,v 1.35 2002/12/12 12:24:18 alex Exp $";
static char UNUSED id[] = "$Id: channel.c,v 1.36 2002/12/13 17:22:57 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -292,6 +292,30 @@ Channel_MemberCount( CHANNEL *Chan )
} /* Channel_MemberCount */
GLOBAL INT
Channel_CountForUser( CHANNEL *Chan, CLIENT *Client )
{
/* Count number of channels a user is member of. */
CL2CHAN *cl2chan;
INT count;
assert( Chan != NULL );
assert( Client != NULL );
count = 0;
cl2chan = My_Cl2Chan;
while( cl2chan )
{
if( cl2chan->client == Client ) count++;
cl2chan = cl2chan->next;
}
return count;
} /* Channel_CountForUser */
GLOBAL CHAR *
Channel_Name( CHANNEL *Chan )
{

View File

@@ -8,7 +8,7 @@
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: channel.h,v 1.23 2002/12/12 12:23:43 alex Exp $
* $Id: channel.h,v 1.24 2002/12/13 17:22:57 alex Exp $
*
* Channel management (header)
*/
@@ -60,6 +60,7 @@ GLOBAL VOID Channel_Kick PARAMS(( CLIENT *Client, CLIENT *Origin, CHAR *Name, CH
GLOBAL LONG Channel_Count PARAMS(( VOID ));
GLOBAL LONG Channel_MemberCount PARAMS(( CHANNEL *Chan ));
GLOBAL INT Channel_CountForUser PARAMS(( CHANNEL *Chan, CLIENT *Client ));
GLOBAL CHAR *Channel_Name PARAMS(( CHANNEL *Chan ));
GLOBAL CHAR *Channel_Modes PARAMS(( CHANNEL *Chan ));