X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Fchannel.h;h=d348184f8ccf9602268a49828270999779444af3;hb=HEAD;hp=c092c56b46c9b809ec87c8a3917075a02952af0c;hpb=a72efcd9b1c000c47bbe363f51c9123528e41d84;p=umurmur.git diff --git a/src/channel.h b/src/channel.h index c092c56..d348184 100644 --- a/src/channel.h +++ b/src/channel.h @@ -1,5 +1,5 @@ -/* Copyright (C) 2009-2010, Martin Johansson - Copyright (C) 2005-2010, Thorvald Natvig +/* Copyright (C) 2009-2014, Martin Johansson + Copyright (C) 2005-2014, Thorvald Natvig All rights reserved. @@ -39,16 +39,30 @@ typedef struct channel { int id; char *name; char *desc; + char *password; struct channel *parent; - bool_t temporary, noenter; + bool_t temporary, noenter, silent; + int position; struct dlist node; struct dlist subs; struct dlist clients; struct dlist flatlist_node; struct dlist channel_links; - struct dlist link_node; + int linkcount; } channel_t; +typedef struct { + channel_t *chan; + struct dlist node; +} channellist_t; + +typedef struct { + bool_t CHJOIN_SILENT, + CHJOIN_NOENTER, + CHJOIN_WRONGPW, + CHJOIN_NOTFOUND; +} channelJoinResult_t; + void Chan_init(); void Chan_free(); void Chan_addChannel(channel_t *parent, channel_t *sub); @@ -58,11 +72,13 @@ void Chan_removeClient(channel_t *c, client_t *client); int Chan_userJoin(channel_t *ch, client_t *client); int Chan_userJoin_id(int channelid, client_t *client); int Chan_userLeave(client_t *client); -bool_t Chan_userJoin_id_test(int channelid); +channelJoinResult_t Chan_userJoin_id_test(int channelid, client_t *client); channel_t *Chan_iterate(channel_t **channelpptr); channel_t *Chan_iterate_siblings(channel_t *parent, channel_t **channelpptr); channel_t *Chan_createChannel(const char *name, const char *desc); channel_t *Chan_fromId(int channelid); void Chan_freeChannel(channel_t *ch); +void Chan_buildTreeList(channel_t *ch, struct dlist *head); +void Chan_freeTreeList(struct dlist *head); #endif