]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/channel.c
Cleanups to 005 code, from ratbox (androsyn).
[irc/rqf/shadowircd.git] / src / channel.c
index d6161d0d65f8bdea8130245fa24e32f284a24f96..757524d090d30152747dcd6bd3d793686799e933 100644 (file)
@@ -21,7 +21,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
  *
- *  $Id: channel.c 3574 2007-10-27 21:56:53Z jilles $
+ *  $Id: channel.c 3580 2007-11-07 23:45:14Z jilles $
  */
 
 #include "stdinc.h"
@@ -93,7 +93,7 @@ allocate_channel(const char *chname)
 {
        struct Channel *chptr;
        chptr = BlockHeapAlloc(channel_heap);
-       DupNString(chptr->chname, chname, CHANNELLEN);
+       DupString(chptr->chname, chname);
        return (chptr);
 }
 
@@ -109,8 +109,8 @@ allocate_ban(const char *banstr, const char *who)
 {
        struct Ban *bptr;
        bptr = BlockHeapAlloc(ban_heap);
-       DupNString(bptr->banstr, banstr, BANLEN);
-       DupNString(bptr->who, who, BANLEN);
+       DupString(bptr->banstr, banstr);
+       DupString(bptr->who, who);
 
        return (bptr);
 }
@@ -931,12 +931,12 @@ check_spambot_warning(struct Client *source_p, const char *name)
                {
                        /* Its already known as a possible spambot */
                        if(name != NULL)
-                               sendto_realops_snomask(SNO_BOTS, L_ALL,
+                               sendto_realops_snomask(SNO_BOTS, L_NETWIDE,
                                                     "User %s (%s@%s) trying to join %s is a possible spambot",
                                                     source_p->name,
                                                     source_p->username, source_p->orighost, name);
                        else
-                               sendto_realops_snomask(SNO_BOTS, L_ALL,
+                               sendto_realops_snomask(SNO_BOTS, L_NETWIDE,
                                                     "User %s (%s@%s) is a possible spambot",
                                                     source_p->name,
                                                     source_p->username, source_p->orighost);
@@ -1084,11 +1084,7 @@ set_channel_topic(struct Channel *chptr, const char *topic, const char *topic_in
        }
 }
 
-static const struct mode_letter
-{
-       const unsigned int mode;
-       const unsigned char letter;
-} flags[] =
+const struct mode_letter chmode_flags[] =
 {
        {MODE_INVITEONLY, 'i'},
        {MODE_MODERATED, 'm'},
@@ -1129,9 +1125,9 @@ channel_modes(struct Channel *chptr, struct Client *client_p)
        *mbuf++ = '+';
        *pbuf = '\0';
 
-       for (i = 0; flags[i].mode; ++i)
-               if(chptr->mode.mode & flags[i].mode)
-                       *mbuf++ = flags[i].letter;
+       for (i = 0; chmode_flags[i].mode; ++i)
+               if(chptr->mode.mode & chmode_flags[i].mode)
+                       *mbuf++ = chmode_flags[i].letter;
 
        if(chptr->mode.limit)
        {