diff options
| author | 2006-12-14 17:46:47 +0000 | |
|---|---|---|
| committer | 2006-12-14 17:46:47 +0000 | |
| commit | a78cecbeb9c677bdd4b2f44c01195759af63485b (patch) | |
| tree | 03b0a71514c6e0dcf6eec78eefe160a2ea7f8b47 /src/modules.cpp | |
| parent | Refactoring: (diff) | |
Refactor userrec::chans.
Old way: A vector of ucrec, MAXCHANS in size by default populated by NULLS, so you have to scan the vector to find an empty slot when joining a user, parting a user etc
New way: std::map<chanrec*, char> (the char holds their basic core permissions on the channel [voice, halfop, op])
This increases speed a ton, and removes some wtf-age.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5986 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules.cpp')
| -rw-r--r-- | src/modules.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/modules.cpp b/src/modules.cpp index b670291ec..16631c1f2 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -472,20 +472,17 @@ bool InspIRCd::PseudoToUser(userrec* alive, userrec* zombie, const std::string & } // Fix by brain - cant write the user until their fd table entry is updated zombie->Write(":%s!%s@%s NICK %s",oldnick.c_str(),oldident.c_str(),oldhost.c_str(),zombie->nick); - for (std::vector<ucrec*>::const_iterator i = zombie->chans.begin(); i != zombie->chans.end(); i++) + for (UCListIter i = zombie->chans.begin(); i != zombie->chans.end(); i++) { - if (((ucrec*)(*i))->channel != NULL) + chanrec* Ptr = i->first; + zombie->WriteFrom(zombie,"JOIN %s",Ptr->name); + if (Ptr->topicset) { - chanrec* Ptr = ((ucrec*)(*i))->channel; - zombie->WriteFrom(zombie,"JOIN %s",Ptr->name); - if (Ptr->topicset) - { - zombie->WriteServ("332 %s %s :%s", zombie->nick, Ptr->name, Ptr->topic); - zombie->WriteServ("333 %s %s %s %d", zombie->nick, Ptr->name, Ptr->setby, Ptr->topicset); - } - Ptr->UserList(zombie); - zombie->WriteServ("366 %s %s :End of /NAMES list.", zombie->nick, Ptr->name); + zombie->WriteServ("332 %s %s :%s", zombie->nick, Ptr->name, Ptr->topic); + zombie->WriteServ("333 %s %s %s %d", zombie->nick, Ptr->name, Ptr->setby, Ptr->topicset); } + Ptr->UserList(zombie); + zombie->WriteServ("366 %s %s :End of /NAMES list.", zombie->nick, Ptr->name); } if ((find(local_users.begin(),local_users.end(),zombie) == local_users.end()) && (zombie->GetFd() != FD_MAGIC_NUMBER)) local_users.push_back(zombie); |
