chmode: Move add_id() to a boolean

This commit is contained in:
Matt Ullman 2016-03-24 14:37:52 -04:00
parent 9aa639eddd
commit a383180a0a
2 changed files with 7 additions and 7 deletions

View file

@ -264,7 +264,7 @@ extern void set_channel_mlock(struct Client *client_p, struct Client *source_p,
extern struct ChannelMode chmode_table[256]; extern struct ChannelMode chmode_table[256];
extern int add_id(struct Client *source_p, struct Channel *chptr, const char *banid, extern bool add_id(struct Client *source_p, struct Channel *chptr, const char *banid,
const char *forward, rb_dlink_list * list, long mode_type); const char *forward, rb_dlink_list * list, long mode_type);
extern struct Ban * del_id(struct Channel *chptr, const char *banid, rb_dlink_list * list, extern struct Ban * del_id(struct Channel *chptr, const char *banid, rb_dlink_list * list,

View file

@ -236,10 +236,10 @@ allow_mode_change(struct Client *source_p, struct Channel *chptr, int alevel,
/* add_id() /* add_id()
* *
* inputs - client, channel, id to add, type, forward * inputs - client, channel, id to add, type, forward
* outputs - 0 on failure, 1 on success * outputs - false on failure, true on success
* side effects - given id is added to the appropriate list * side effects - given id is added to the appropriate list
*/ */
int bool
add_id(struct Client *source_p, struct Channel *chptr, const char *banid, const char *forward, add_id(struct Client *source_p, struct Channel *chptr, const char *banid, const char *forward,
rb_dlink_list * list, long mode_type) rb_dlink_list * list, long mode_type)
{ {
@ -257,14 +257,14 @@ add_id(struct Client *source_p, struct Channel *chptr, const char *banid, const
{ {
sendto_one(source_p, form_str(ERR_BANLISTFULL), sendto_one(source_p, form_str(ERR_BANLISTFULL),
me.name, source_p->name, chptr->chname, realban); me.name, source_p->name, chptr->chname, realban);
return 0; return false;
} }
RB_DLINK_FOREACH(ptr, list->head) RB_DLINK_FOREACH(ptr, list->head)
{ {
actualBan = ptr->data; actualBan = ptr->data;
if(mask_match(actualBan->banstr, realban)) if(mask_match(actualBan->banstr, realban))
return 0; return false;
} }
} }
/* dont let remotes set duplicates */ /* dont let remotes set duplicates */
@ -274,7 +274,7 @@ add_id(struct Client *source_p, struct Channel *chptr, const char *banid, const
{ {
actualBan = ptr->data; actualBan = ptr->data;
if(!irccmp(actualBan->banstr, realban)) if(!irccmp(actualBan->banstr, realban))
return 0; return false;
} }
} }
@ -293,7 +293,7 @@ add_id(struct Client *source_p, struct Channel *chptr, const char *banid, const
if(mode_type == CHFL_BAN || mode_type == CHFL_QUIET || mode_type == CHFL_EXCEPTION) if(mode_type == CHFL_BAN || mode_type == CHFL_QUIET || mode_type == CHFL_EXCEPTION)
chptr->bants++; chptr->bants++;
return 1; return true;
} }
/* del_id() /* del_id()