- /* As spotted by jilles, dont bother to set this on remote users */
- if (IS_LOCAL(user) && Ptr->GetUserCounter() == 1)
- Ptr->SetDefaultModes();
-
- return Channel::ForceChan(Instance, Ptr, user, privs, bursting);
-}
-
-Channel *Channel::CreateChannel(InspIRCd *ServerInstance, const std::string &name, time_t ts)
-{
- /* create a new one */
- Channel *c = new Channel(ServerInstance);
- (*(ServerInstance->chanlist))[name.c_str()] = c;
-
- strlcpy(c->name, name.c_str(), CHANMAX);
- c->created = ts ? ts : ServerInstance->Time();
- c->age = c->created;
- return c;
+ // We figured that this join is allowed and also created the
+ // channel if it didn't exist before, now do the actual join
+ chan->ForceJoin(user, &privs, false, created_by_local);
+ return chan;