- /* NOTE: If the user is an oper here, we can extend their user->chans by up to
- * OPERMAXCHANS. For remote users which are not bound by the channel limits,
- * we can extend infinitely. Otherwise, nope, youre restricted to MAXCHANS.
- */
- if (!IS_LOCAL(user) || override == true) /* was a check on fd < 0 */
- {
- return chanrec::ForceChan(Instance, Ptr, user, privs);
- }
- else if (*user->oper)
- {
- /* Oper allows extension up to the OPERMAXCHANS value */
- if (user->chans.size() < OPERMAXCHANS)
- {
- return chanrec::ForceChan(Instance, Ptr, user, privs);
- }
- }
- else if (user->chans.size() < MAXCHANS)
- {
- return chanrec::ForceChan(Instance, Ptr, user, privs);
- }
-
-
- user->WriteServ("405 %s %s :You are on too many channels",user->nick, cname);
-
- if (new_channel)
- {
- Instance->Log(DEBUG,"BLAMMO, Whacking channel.");
- /* Things went seriously pear shaped, so take this away. bwahaha. */
- chan_hash::iterator n = Instance->chanlist.find(cname);
- if (n != Instance->chanlist.end())
- {
- Ptr->DelUser(user);
- DELETE(Ptr);
- Instance->chanlist.erase(n);
- }
- }
+ /* As spotted by jilles, dont bother to set this on remote users */
+ if (IS_LOCAL(user) && Ptr->GetUserCounter() == 0)
+ Ptr->SetDefaultModes();