diff options
Diffstat (limited to 'src/channels.cpp')
-rw-r--r-- | src/channels.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index c51321a64..a1a7d60fa 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -160,25 +160,23 @@ long chanrec::GetUserCounter() void chanrec::AddUser(char* castuser) { - internal_userlist.push_back(castuser); + internal_userlist[castuser] = castuser; log(DEBUG,"Added casted user to channel's internal list"); } void chanrec::DelUser(char* castuser) { - for (std::vector<char*>::iterator a = internal_userlist.begin(); a < internal_userlist.end(); a++) + std::map<char*,char*>::iterator a = internal_userlist.find(castuser); + if (a != internal_userlist.end()) { - if (*a == castuser) - { - log(DEBUG,"Removed casted user from channel's internal list"); - internal_userlist.erase(a); - return; - } + log(DEBUG,"Removed casted user from channel's internal list"); + internal_userlist.erase(a); + return; } log(DEBUG,"BUG BUG BUG! Attempt to remove an uncasted user from the internal list of %s!",name); } -std::vector<char*> *chanrec::GetUsers() +std::map<char*,char*> *chanrec::GetUsers() { return &internal_userlist; } |