diff --git a/include/channel.h b/include/channel.h index df6008e..22b7e70 100644 --- a/include/channel.h +++ b/include/channel.h @@ -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 *); diff --git a/src/channel.c b/src/channel.c index 36ad743..0fd0f03 100644 --- a/src/channel.c +++ b/src/channel.c @@ -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