]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
Backed out changeset c04f6578869c
authorJD Horelick <redacted>
Sat, 11 Sep 2010 17:31:00 +0000 (13:31 -0400)
committerJD Horelick <redacted>
Sat, 11 Sep 2010 17:31:00 +0000 (13:31 -0400)
include/channel.h
src/channel.c

index d6514d2c4f4c9edc1966e95ec9ca4afc1cc5ade8..64bd1b1bb3e1a1ff4e2504c70b283e4dd4d60f91 100644 (file)
@@ -268,9 +268,7 @@ extern void channel_member_names(struct Channel *chptr, struct Client *,
 
 extern void del_invite(struct Channel *chptr, struct Client *who);
 
-const char *channel_modes_real(struct Channel *chptr, struct Mode *mode, struct Client *who);
-#define channel_modes(chptr, who)   channel_modes_real(chptr, &(chptr)->mode, who)
-#define channel_mlock(chptr, who)   channel_modes_real(chptr, &(chptr)->mode_lock, who)
+const char *channel_modes(struct Channel *chptr, struct Client *who);
 
 extern int has_common_channel(struct Client *client1, struct Client *client2);
 
index 3749e7a1efcca7bab91b731650d9b4d58d581281..af30d4ef86fb700a044b5f458ea559644112091a 100644 (file)
@@ -1286,10 +1286,9 @@ has_common_channel(struct Client *client1, struct Client *client2)
        return 0;
 }
 
-/* channel_modes_real()
+/* channel_modes()
  *
  * inputs       - pointer to channel
- *             - pointer to channel mode struct
  *              - pointer to client
  * output       - string with simple modes
  * side effects - result from previous calls overwritten
@@ -1297,7 +1296,7 @@ has_common_channel(struct Client *client1, struct Client *client2)
  * Stolen from ShadowIRCd 4 --nenolod
  */
 const char *
-channel_modes_real(struct Channel *chptr, struct Mode *mode, struct Client *client_p)
+channel_modes(struct Channel *chptr, struct Client *client_p)
 {
        int i;
        char buf1[BUFSIZE];
@@ -1313,41 +1312,41 @@ channel_modes_real(struct Channel *chptr, struct Mode *mode, struct Client *clie
        {
                if(chmode_table[i].set_func == chm_hidden && !IsOper(client_p) && IsClient(client_p))
                        continue;
-               if(mode->mode & chmode_flags[i])
+               if(chptr->mode.mode & chmode_flags[i])
                        *mbuf++ = i;
        }
 
-       if(mode->limit)
+       if(chptr->mode.limit)
        {
                *mbuf++ = 'l';
 
                if(!IsClient(client_p) || IsMember(client_p, chptr))
-                       pbuf += rb_sprintf(pbuf, " %d", mode->limit);
+                       pbuf += rb_sprintf(pbuf, " %d", chptr->mode.limit);
        }
 
-       if(mode->key)
+       if(*chptr->mode.key)
        {
                *mbuf++ = 'k';
 
                if(pbuf > buf2 || !IsClient(client_p) || IsMember(client_p, chptr))
-                       pbuf += rb_sprintf(pbuf, " %s", mode->key);
+                       pbuf += rb_sprintf(pbuf, " %s", chptr->mode.key);
        }
 
-       if(mode->join_num)
+       if(chptr->mode.join_num)
        {
                *mbuf++ = 'j';
 
                if(pbuf > buf2 || !IsClient(client_p) || IsMember(client_p, chptr))
-                       pbuf += rb_sprintf(pbuf, " %d:%d", mode->join_num,
-                                          mode->join_time);
+                       pbuf += rb_sprintf(pbuf, " %d:%d", chptr->mode.join_num,
+                                          chptr->mode.join_time);
        }
 
-       if(mode->forward && (ModuleModes.MODE_FORWARD || !IsClient(client_p)))
+       if(*chptr->mode.forward && (ModuleModes.MODE_FORWARD || !IsClient(client_p)))
        {
                *mbuf++ = 'f';
 
                if(pbuf > buf2 || !IsClient(client_p) || IsMember(client_p, chptr))
-                       pbuf += rb_sprintf(pbuf, " %s", mode->forward);
+                       pbuf += rb_sprintf(pbuf, " %s", chptr->mode.forward);
        }
 
        *mbuf = '\0';