]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Finish channels.cpp conversion to numerics list
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 13 Jul 2008 19:05:31 +0000 (19:05 +0000)
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 13 Jul 2008 19:05:31 +0000 (19:05 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10007 e03df62e-2008-0410-955e-edbf42e46eb7

include/numerics.h
src/channels.cpp

index 6a587a5b3519bbf6f34ecfa9e47a72e923a6ff3e..f78cd60d01985a435fec817d66997728754341d4 100644 (file)
@@ -28,14 +28,19 @@ enum Numerics
         */
        RPL_TOPIC                                               =       332,
        RPL_TOPICTIME                                   =       333,
+       RPL_NAMREPLY                                    =       353,
+       RPL_ENDOFNAMES                                  =       366,
 
 
        /*
         * Error range of numerics.
         */
+       ERR_NOSUCHNICK                                  =       401,
        ERR_TOOMANYCHANNELS                             =       405,
+       ERR_USERNOTINCHANNEL                    =       441,
        ERR_BADCHANNELKEY                               =       475,
        ERR_INVITEONLYCHAN                              =       473,
        ERR_CHANNELISFULL                               =       471,
-       ERR_BANNEDFROMCHAN                              =       474
+       ERR_BANNEDFROMCHAN                              =       474,
+       ERR_CHANOPRIVSNEEDED                    =       482
 };
index c9e0209d9139fc56c31c5df5611ba1c04cc77ee5..b9bc4992c6014d50107dfc462c63d1183d3dd1d9 100644 (file)
@@ -611,12 +611,12 @@ long Channel::KickUser(User *src, User *user, const char* reason)
        {
                if (!this->HasUser(user))
                {
-                       src->WriteNumeric(441, "%s %s %s :They are not on that channel",src->nick.c_str(), user->nick.c_str(), this->name.c_str());
+                       src->WriteNumeric(ERR_USERNOTINCHANNEL, "%s %s %s :They are not on that channel",src->nick.c_str(), user->nick.c_str(), this->name.c_str());
                        return this->GetUserCounter();
                }
                if ((ServerInstance->ULine(user->server)) && (!ServerInstance->ULine(src->server)))
                {
-                       src->WriteNumeric(482, "%s %s :Only a u-line may kick a u-line from a channel.",src->nick.c_str(), this->name.c_str());
+                       src->WriteNumeric(ERR_CHANOPRIVSNEEDED, "%s %s :Only a u-line may kick a u-line from a channel.",src->nick.c_str(), this->name.c_str());
                        return this->GetUserCounter();
                }
                int MOD_RESULT = 0;
@@ -641,7 +641,7 @@ long Channel::KickUser(User *src, User *user, const char* reason)
                                int us = this->GetStatus(user);
                                if ((them < STATUS_HOP) || (them < us))
                                {
-                                       src->WriteNumeric(482, "%s %s :You must be a channel %soperator",src->nick.c_str(), this->name.c_str(), them == STATUS_HOP ? "" : "half-");
+                                       src->WriteNumeric(ERR_CHANOPRIVSNEEDED, "%s %s :You must be a channel %soperator",src->nick.c_str(), this->name.c_str(), them == STATUS_HOP ? "" : "half-");
                                        return this->GetUserCounter();
                                }
                        }
@@ -897,7 +897,7 @@ void Channel::UserList(User *user, CUList *ulist)
        {
                if ((this->IsModeSet('s')) && (!this->HasUser(user)))
                {
-                       user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick.c_str(), this->name.c_str());
+                       user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nick/channel",user->nick.c_str(), this->name.c_str());
                        return;
                }
        }
@@ -967,10 +967,10 @@ void Channel::UserList(User *user, CUList *ulist)
        /* if whats left in the list isnt empty, send it */
        if (numusers)
        {
-               user->WriteNumeric(353,std::string(list));
+               user->WriteNumeric(RPL_NAMREPLY, std::string(list));
        }
 
-       user->WriteNumeric(366, "%s %s :End of /NAMES list.", user->nick.c_str(), this->name.c_str());
+       user->WriteNumeric(RPL_ENDOFNAMES, "%s %s :End of /NAMES list.", user->nick.c_str(), this->name.c_str());
 }
 
 long Channel::GetMaxBans()