]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/channels.cpp
Add some defaults to serverconfig, removing need to set them in validate methods...
[user/henk/code/inspircd.git] / src / channels.cpp
index b6912e24530d09a0b9e0d83151dda182d8697adc..ea7edd71fbd2aac33a8cf07309e5bfdaff7769a2 100644 (file)
@@ -1,21 +1,16 @@
-/*   +------------------------------------+
- *   | Inspire Internet Relay Chat Daemon |
- *   +------------------------------------+
+/*       +------------------------------------+
+ *       | Inspire Internet Relay Chat Daemon |
+ *       +------------------------------------+
+ *
+ *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
  *
- *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
- *   E-mail:
- *       <brain@chatspike.net>
- *       <Craig@chatspike.net>
- * 
- * Written by Craig Edwards, Craig McLure, and others.
  * This program is free but copyrighted software; see
- *     the file COPYING for details.
+ *            the file COPYING for details.
  *
  * ---------------------------------------------------
  */
 
-using namespace std;
-
 #include <stdarg.h>
 #include "configreader.h"
 #include "inspircd.h"
@@ -222,7 +217,7 @@ chanrec* chanrec::JoinUser(InspIRCd* Instance, userrec *user, const char* cn, bo
 
                /* create a new one */
                Ptr = new chanrec(Instance);
-               Instance->chanlist[cname] = Ptr;
+               (*(Instance->chanlist))[cname] = Ptr;
 
                strlcpy(Ptr->name, cname,CHANMAX);
 
@@ -346,12 +341,12 @@ chanrec* chanrec::JoinUser(InspIRCd* Instance, userrec *user, const char* cn, bo
        {
                Instance->Log(DEBUG,"BLAMMO, Whacking channel.");
                /* Things went seriously pear shaped, so take this away. bwahaha. */
-               chan_hash::iterator n = Instance->chanlist.find(cname);
-               if (n != Instance->chanlist.end())
+               chan_hash::iterator n = Instance->chanlist->find(cname);
+               if (n != Instance->chanlist->end())
                {
                        Ptr->DelUser(user);
                        DELETE(Ptr);
-                       Instance->chanlist.erase(n);
+                       Instance->chanlist->erase(n);
                }
        }
 
@@ -469,13 +464,13 @@ long chanrec::PartUser(userrec *user, const char* reason)
 
        if (!this->DelUser(user)) /* if there are no users left on the channel... */
        {
-               chan_hash::iterator iter = ServerInstance->chanlist.find(this->name);
+               chan_hash::iterator iter = ServerInstance->chanlist->find(this->name);
                /* kill the record */
-               if (iter != ServerInstance->chanlist.end())
+               if (iter != ServerInstance->chanlist->end())
                {
                        ServerInstance->Log(DEBUG,"del_channel: destroyed: %s", this->name);
                        FOREACH_MOD(I_OnChannelDelete,OnChannelDelete(this));
-                       ServerInstance->chanlist.erase(iter);
+                       ServerInstance->chanlist->erase(iter);
                }
                return 0;
        }
@@ -512,12 +507,12 @@ long chanrec::ServerKickUser(userrec* user, const char* reason, bool triggereven
 
        if (!this->DelUser(user))
        {
-               chan_hash::iterator iter = ServerInstance->chanlist.find(this->name);
+               chan_hash::iterator iter = ServerInstance->chanlist->find(this->name);
                /* kill the record */
-               if (iter != ServerInstance->chanlist.end())
+               if (iter != ServerInstance->chanlist->end())
                {
                        FOREACH_MOD(I_OnChannelDelete,OnChannelDelete(this));
-                       ServerInstance->chanlist.erase(iter);
+                       ServerInstance->chanlist->erase(iter);
                }
                return 0;
        }
@@ -585,13 +580,13 @@ long chanrec::KickUser(userrec *src, userrec *user, const char* reason)
        if (!this->DelUser(user))
        /* if there are no users left on the channel */
        {
-               chan_hash::iterator iter = ServerInstance->chanlist.find(this->name);
+               chan_hash::iterator iter = ServerInstance->chanlist->find(this->name);
 
                /* kill the record */
-               if (iter != ServerInstance->chanlist.end())
+               if (iter != ServerInstance->chanlist->end())
                {
                        FOREACH_MOD(I_OnChannelDelete,OnChannelDelete(this));
-                       ServerInstance->chanlist.erase(iter);
+                       ServerInstance->chanlist->erase(iter);
                }
                return 0;
        }