]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/core/m_join.c
Remove various unused macros.
[irc/rqf/shadowircd.git] / modules / core / m_join.c
index 6525064a7cce401794d95bccbd4c6ae9afa8d539..43186ac553ebe5bb6a63a19286a6395794443b5f 100644 (file)
@@ -21,7 +21,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
  *
- *  $Id: m_join.c 3211 2007-02-20 00:34:28Z jilles $
+ *  $Id: m_join.c 3494 2007-05-27 13:07:27Z jilles $
  */
 
 #include "stdinc.h"
@@ -62,7 +62,7 @@ mapi_hlist_av1 join_hlist[] = {
        { NULL, NULL },
 };
 
-DECLARE_MODULE_AV1(join, NULL, NULL, join_clist, join_hlist, NULL, "$Revision: 3211 $");
+DECLARE_MODULE_AV1(join, NULL, NULL, join_clist, join_hlist, NULL, "$Revision: 3494 $");
 
 static void do_join_0(struct Client *client_p, struct Client *source_p);
 static int check_channel_name_loc(struct Client *source_p, const char *name);
@@ -150,7 +150,7 @@ m_join(struct Client *client_p, struct Client *source_p, int parc, const char *p
                }
 
                /* join 0 parts all channels */
-               if(*name == '0' && !atoi(name))
+               if(*name == '0' && (name[1] == ',' || name[1] == '\0') && name == chanlist)
                {
                        (void) strcpy(jbuf, "0");
                        continue;
@@ -236,7 +236,7 @@ m_join(struct Client *client_p, struct Client *source_p, int parc, const char *p
 
                        call_hook(h_can_create_channel, &moduledata);
 
-                       if(moduledata.approved != 0 && !IsOper(source_p))
+                       if(moduledata.approved != 0)
                        {
                                sendto_one(source_p, form_str(moduledata.approved),
                                           me.name, source_p->name, name);
@@ -480,6 +480,9 @@ ms_join(struct Client *client_p, struct Client *source_p, int parc, const char *
                                     ":%s NOTICE %s :*** Notice -- TS for %s changed from %ld to %ld",
                                     me.name, chptr->chname, chptr->chname,
                                     (long) oldts, (long) newts);
+               /* Update capitalization in channel name, this makes the
+                * capitalization timestamped like modes are -- jilles */
+               strcpy(chptr->chname, parv[2]);
                if(*modebuf != '\0')
                        sendto_channel_local(ALL_MEMBERS, chptr,
                                             ":%s MODE %s %s %s",
@@ -508,7 +511,7 @@ ms_join(struct Client *client_p, struct Client *source_p, int parc, const char *
                      source_p->id, (long) chptr->channelts, chptr->chname);
        sendto_server(client_p, chptr, NOCAPS, CAP_TS6,
                      ":%s SJOIN %ld %s %s :%s",
-                     source_p->user->server, (long) chptr->channelts,
+                     source_p->servptr->name, (long) chptr->channelts,
                      chptr->chname, keep_new_modes ? "+" : "0",
                      source_p->name);
        return 0;
@@ -536,7 +539,8 @@ do_join_0(struct Client *client_p, struct Client *source_p)
                flood_endgrace(source_p);
 
 
-       sendto_server(client_p, NULL, NOCAPS, NOCAPS, ":%s JOIN 0", source_p->name);
+       sendto_server(client_p, NULL, CAP_TS6, NOCAPS, ":%s JOIN 0", use_id(source_p));
+       sendto_server(client_p, NULL, NOCAPS, CAP_TS6, ":%s JOIN 0", source_p->name);
 
        if(source_p->user->channel.head && MyConnect(source_p) &&
           !IsOper(source_p) && !IsExemptSpambot(source_p))