]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix NAMES list getting truncated on servers having an excessively long server name
authorAttila Molnar <attilamolnar@hush.com>
Thu, 13 Mar 2014 14:41:10 +0000 (15:41 +0100)
committerAttila Molnar <attilamolnar@hush.com>
Thu, 13 Mar 2014 14:41:10 +0000 (15:41 +0100)
src/channels.cpp

index 73d408fb851e5596b48fe9dc7e3b44f837a80407..6c9bd7c85130f8927758c06895118f26861d09bc 100644 (file)
@@ -783,6 +783,7 @@ void Channel::UserList(User *user)
         */
        bool has_user = this->HasUser(user);
 
+       const size_t maxlen = MAXBUF - 10 - ServerInstance->Config->ServerName.size();
        std::string prefixlist;
        std::string nick;
        for (UserMembIter i = userlist.begin(); i != userlist.end(); ++i)
@@ -807,7 +808,7 @@ void Channel::UserList(User *user)
                if (nick.empty())
                        continue;
 
-               if (list.size() + prefixlist.length() + nick.length() + 1 > 480)
+               if (list.size() + prefixlist.length() + nick.length() + 1 > maxlen)
                {
                        /* list overflowed into multiple numerics */
                        user->WriteNumeric(RPL_NAMREPLY, list);