Move is_chanop_voiced() to a function in channels.c in preperation for +ah.

This commit is contained in:
B.Greenham 2010-02-27 19:40:52 -05:00
parent 7a425f2db3
commit bbc6973347
2 changed files with 17 additions and 2 deletions

View File

@ -153,7 +153,6 @@ typedef int (*ExtbanFunc)(const char *data, struct Client *client_p,
#define is_chanop(x) ((x) && (x)->flags & CHFL_CHANOP)
#define is_voiced(x) ((x) && (x)->flags & CHFL_VOICE)
#define is_chanop_voiced(x) ((x) && (x)->flags & (CHFL_CHANOP|CHFL_VOICE))
#define can_send_banned(x) ((x) && (x)->flags & (CHFL_BANNED|CHFL_QUIETED))
/* channel modes ONLY */
@ -229,6 +228,7 @@ extern int can_join(struct Client *source_p, struct Channel *chptr, char *key);
extern struct membership *find_channel_membership(struct Channel *, struct Client *);
extern const char *find_channel_status(struct membership *msptr, int combine);
extern int is_any_op(struct membership *msptr);
extern int is_chanop_voiced(struct membership *msptr);
extern void add_user_to_channel(struct Channel *, struct Client *, int flags);
extern void remove_user_from_channel(struct membership *);
extern void remove_user_from_channels(struct Client *);

View File

@ -200,7 +200,6 @@ find_channel_status(struct membership *msptr, int combine)
* output - 1 if the user is op, halfop, or owner, 0 elsewise
* side effects -
*/
int
is_any_op(struct membership *msptr)
{
@ -211,6 +210,22 @@ is_any_op(struct membership *msptr)
return 0;
}
/* is_chanop_voiced()
*
* input - memebership to check for status
* output - 1 if the user is op, halfop, owner, or voice, 0 elsewise
* side effects -
*/
int
is_chanop_voiced(struct membership *msptr)
{
/* Checks for +ah will go here when +ah are implemented */
if(is_chanop(msptr) || is_voiced(msptr))
return 1;
else
return 0;
}
/* add_user_to_channel()
*
* input - channel to add client to, client to add, channel flags