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 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 *);
* Remove user from the old channel (if any)
* only allow /part reasons in -m chans
*/
- if(reason[0] && (is_chanop(msptr) || !MyConnect(source_p) ||
+ if(reason[0] && (is_any_op(msptr) || !MyConnect(source_p) ||
((can_send(chptr, source_p, msptr) > 0 &&
(source_p->localClient->firsttime +
ConfigFileEntry.anti_spam_exit_message_time) < rb_current_time()))))
/* unconditionally require ops, unless the channel is +g */
/* treat remote clients as chanops */
- if(MyClient(source_p) && !is_chanop(msptr) && !IsOverride(source_p) &&
+ if(MyClient(source_p) && !is_any_op(msptr) && !IsOverride(source_p) &&
!(chptr->mode.mode & MODE_FREEINVITE))
{
sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED),
return 0;
}
- if((chptr->mode.mode & MODE_TOPICLIMIT) == 0 || is_chanop(msptr) || IsOverride(source_p))
+ if((chptr->mode.mode & MODE_TOPICLIMIT) == 0 || is_any_op(msptr) || IsOverride(source_p))
{
char topic_info[USERHOST_REPLYLEN];
return buffer;
}
+/* is_any_op()
+ *
+ * input - membership to check for ops
+ * output - 1 if the user is op, halfop, or owner, 0 elsewise
+ * side effects -
+ */
+
+int
+is_any_op(struct membership *msptr)
+{
+ /* Checks for +ah will go here when +ah are implemented */
+ if(is_chanop(msptr))
+ return 1;
+ else
+ return 0;
+}
+
/* add_user_to_channel()
*
* input - channel to add client to, client to add, channel flags
{
msptr = ptr->data;
chptr = msptr->chptr;
- if (is_chanop_voiced(msptr))
+ if (is_any_op(msptr))
continue;
if (chptr->mode.mode & MODE_NONICK)
return chptr;