diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-23 20:29:09 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-23 20:29:09 +0000 |
commit | b83765d756c2568d15b87654963b5237d0482367 (patch) | |
tree | e005a9ef1ee8f87d7903aa19bb6012e5b082c2e1 /src | |
parent | 8b864c8a828d6ca97b5ec15fa7bf8fcc35027294 (diff) |
Spotted problem: must clear out all prefixes attached to a user when they quit or leave a channel
Next thing to do, consider removing of opped_userlist, halfopped_userlist and voiced_userlist as this data is now in the prefixlist
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4998 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/channels.cpp | 10 | ||||
-rw-r--r-- | src/users.cpp | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 4d68af99c..312e78aa6 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -482,6 +482,7 @@ long chanrec::PartUser(userrec *user, const char* reason) } user->chans[i]->uc_modes = 0; user->chans[i]->channel = NULL; + this->RemoveAllPrefixes(user); break; } } @@ -528,6 +529,7 @@ long chanrec::ServerKickUser(userrec* user, const char* reason, bool triggereven this->WriteChannelWithServ(ServerInstance->Config->ServerName, "KICK %s %s :%s", this->name, user->nick, reason); user->chans[i]->uc_modes = 0; user->chans[i]->channel = NULL; + this->RemoveAllPrefixes(user); break; } } @@ -610,6 +612,7 @@ long chanrec::KickUser(userrec *src, userrec *user, const char* reason) this->WriteChannel(src, "KICK %s %s :%s", this->name, user->nick, reason); (*i)->uc_modes = 0; (*i)->channel = NULL; + this->RemoveAllPrefixes(user); break; } } @@ -976,3 +979,10 @@ void chanrec::SetPrefix(userrec* user, char prefix, unsigned int prefix_value, b } } +void chanrec::RemoveAllPrefixes(userrec* user) +{ + prefixlist::iterator n = prefixes.find(user); + if (n != prefixes.end()) + prefixes.erase(n); +} + diff --git a/src/users.cpp b/src/users.cpp index 3953db233..3b02e82b9 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1744,6 +1744,7 @@ void userrec::PurgeEmptyChannels() ucrec* uc = *f; if (uc->channel) { + uc->channel->RemoveAllPrefixes(this); if (uc->channel->DelUser(this) == 0) { /* No users left in here, mark it for deletion */ |