]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
Add is_any_op() in preperation for adding +ah, start using it instead of is_chanop...
authorB.Greenham <redacted>
Sun, 28 Feb 2010 00:20:01 +0000 (19:20 -0500)
committerB.Greenham <redacted>
Sun, 28 Feb 2010 00:20:01 +0000 (19:20 -0500)
include/channel.h
modules/core/m_part.c
modules/m_invite.c
modules/m_topic.c
src/channel.c

index 9e84dcec0421478737ce2044e8089e6db3bb1dba..df6008ea9aebc860ada62048a3cab124bce5472e 100644 (file)
@@ -228,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 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 *);
index 5e38047aac3b8cb8b118167f012e34e9a46f9822..61c585b7c2ce540b9cf1b0b515f08ee511b36b33 100644 (file)
@@ -123,7 +123,7 @@ part_one_client(struct Client *client_p, struct Client *source_p, char *name, ch
         *  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()))))
index 7eef5c02b669eec6188a2f83794c8a77f278b37c..2a711e4820f558fa5335471b14a1bb7d106dbbfd 100644 (file)
@@ -145,7 +145,7 @@ m_invite(struct Client *client_p, struct Client *source_p, int parc, const char
 
        /* 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),
index 001a5e1cdc7c50b3521c66393ac05a2f91e45ee6..e81ce2ca2740f43e33f6ebed6f4b6ab010004c3b 100644 (file)
@@ -114,7 +114,7 @@ m_topic(struct Client *client_p, struct Client *source_p, int parc, const char *
                        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];
 
index a5f53a2724d4f0c3e4dbda232d9c3865a42ce750..36ad7430324d15b5c93061b8249b99a4d63a2dc3 100644 (file)
@@ -194,6 +194,23 @@ find_channel_status(struct membership *msptr, int combine)
        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
@@ -928,7 +945,7 @@ find_nonickchange_channel(struct Client *client_p)
        {
                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;