diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-01-24 12:58:01 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-01-24 12:58:01 +0100 |
commit | 932e8d13f81c7c94a89dc3702f6d45bc185f5dcf (patch) | |
tree | cb50264af2ff50ccf8070ce9123ee350d95ff7f8 /src/channels.cpp | |
parent | 9a962e1c512ffc00bcfce105e9dbdabd9abcdd86 (diff) |
Convert UserChanList to an intrusively linked list
Diffstat (limited to 'src/channels.cpp')
-rw-r--r-- | src/channels.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 5865f6724..7763febd5 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -331,7 +331,7 @@ void Channel::ForceJoin(User* user, const std::string* privs, bool bursting, boo if (!memb) return; // Already on the channel - user->chans.insert(this); + user->chans.push_front(memb); if (privs) { @@ -466,7 +466,7 @@ void Channel::PartUser(User *user, std::string &reason) WriteAllExcept(user, false, 0, except_list, "PART %s%s%s", this->name.c_str(), reason.empty() ? "" : " :", reason.c_str()); // Remove this channel from the user's chanlist - user->chans.erase(this); + user->chans.erase(memb); // Remove the Membership from this channel's userlist and destroy it this->DelUser(membiter); } @@ -520,7 +520,7 @@ void Channel::KickUser(User* src, User* victim, const std::string& reason, Membe WriteAllExcept(src, false, 0, except_list, "KICK %s %s :%s", name.c_str(), victim->nick.c_str(), reason.c_str()); - victim->chans.erase(this); + victim->chans.erase(memb); this->DelUser(victimiter); } |