- }
- }
- else
- {
- Instance->Log(DEBUG,"chanrec::JoinUser(): Overridden checks");
- }
- }
-
- for (UserChanList::const_iterator index = user->chans.begin(); index != user->chans.end(); index++)
- {
- if ((*index)->channel == NULL)
- {
- return chanrec::ForceChan(Instance, Ptr, *index, user, privs);
- }
- }
-
- /*
- * XXX: If the user is an oper here, we can just extend their user->chans vector by one
- * and put the channel in here. Same for remote users which are not bound by
- * the channel limits. Otherwise, nope, youre boned.
- */
- if (!IS_LOCAL(user)) /* was a check on fd < 0 */
- {
- ucrec* a = new ucrec();
- chanrec* c = chanrec::ForceChan(Instance, Ptr, a, user, privs);
- user->chans.push_back(a);
- return c;
- }
- else if (*user->oper)
- {
- /* Oper allows extension up to the OPERMAXCHANS value */
- if (user->chans.size() < OPERMAXCHANS)
- {
- ucrec* a = new ucrec();
- chanrec* c = chanrec::ForceChan(Instance, Ptr, a, user, privs);
- user->chans.push_back(a);
- return c;
- }
- }