aboutsummaryrefslogtreecommitdiffstats
path: root/src/channels.cpp
diff options
context:
space:
mode:
authorGravatar brain2008-03-29 14:58:46 +0000
committerGravatar brain2008-03-29 14:58:46 +0000
commit3df02f388c4d9c61d0e75dbcf0a091cd0ce2fb06 (patch)
tree9b55c784ca1a3ec1674e806962cde9f958d7c8b8 /src/channels.cpp
parentDon't desync when trying to remotely set swhois on a user who already has one (diff)
Fix for bug #506 reported by Skip
git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@9202 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 691839ac7..7b268e3b3 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -881,16 +881,15 @@ void chanrec::UserList(userrec *user, CUList *ulist)
continue;
size_t ptrlen = snprintf(ptr, MAXBUF, "%s%s ", this->GetPrefixChar(i->first), i->second.c_str());
- /* OnUserList can change this - reset it back to normal */
- i->second = i->first->nick;
curlen += ptrlen;
ptr += ptrlen;
numusers++;
- if (curlen > (480-NICKMAX))
- {
+ /* Fix for bug #506 reported by Skip, often seen by w00t :p */
+ if (curlen > (480-i->second.length()))
+ {
/* list overflowed into multiple numerics */
user->WriteServ(std::string(list));
@@ -901,6 +900,9 @@ void chanrec::UserList(userrec *user, CUList *ulist)
ptrlen = 0;
numusers = 0;
}
+
+ /* OnUserList can change this - reset it back to normal */
+ i->second = i->first->nick;
}
/* if whats left in the list isnt empty, send it */