Leave channel when disconnecting and remove channel if temporary and last user.
[umurmur.git] / src / channel.h
index d63d53262c21d9299ad63fc9eef68183847de14e..cd916c29ebe59925594ed3f948c31919020c3db8 100644 (file)
 
 typedef struct channel {
        int id;
-       char name[MAX_TEXT];
-       char desc[MAX_TEXT];
+       char *name;
+       char *desc;
        struct channel *parent;
+       bool_t temporary, noenter;
        struct dlist node;
        struct dlist subs;
        struct dlist clients;
@@ -54,9 +55,12 @@ void Chan_addChannel(channel_t *parent, channel_t *sub);
 void Chan_removeChannel(channel_t *c);
 void Chan_addClient(channel_t *c, client_t *client);
 void Chan_removeClient(channel_t *c, client_t *client);
-void Chan_playerJoin(channel_t *ch, client_t *client);
-void Chan_playerJoin_id(int channelid, client_t *client);
-void Chan_iterate(channel_t **channelpptr);
+int Chan_playerJoin(channel_t *ch, client_t *client);
+int Chan_playerJoin_id(int channelid, client_t *client);
+int Chan_playerLeave(client_t *client);
+bool_t Chan_playerJoin_id_test(int channelid);
+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);