1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2010 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
16 /* $ModDesc: Forces users to join the specified channel(s) on connect */
18 class ModuleConnJoin : public Module
23 Implementation eventlist[] = { I_OnPostConnect };
24 ServerInstance->Modules->Attach(eventlist, this, 1);
29 ServerInstance->Modules->SetPriority(this, I_OnPostConnect, PRIORITY_LAST);
34 return Version("Forces users to join the specified channel(s) on connect", VF_VENDOR);
37 void OnPostConnect(User* user)
42 std::string chanlist = ServerInstance->Config->ConfValue("autojoin")->getString("channel");
43 chanlist = user->GetClass()->config->getString("autojoin", chanlist);
45 irc::commasepstream chans(chanlist);
48 while (chans.GetToken(chan))
50 if (ServerInstance->IsChannel(chan.c_str(), ServerInstance->Config->Limits.ChanMax))
51 Channel::JoinUser(user, chan.c_str(), false, "", false, ServerInstance->Time());
57 MODULE_INIT(ModuleConnJoin)