aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_conn_join.cpp
diff options
context:
space:
mode:
authorGravatar attilamolnar2013-04-12 16:00:17 +0200
committerGravatar attilamolnar2013-04-13 16:05:54 +0200
commitb98acac5c91ecb08da28d70185818a19991eb1db (patch)
treea72446ebf241ced2b21939eb8adb7a0045274dfe /src/modules/m_conn_join.cpp
parentOnUserPreJoin is a local-only hook, change User* parameter to LocalUser* (diff)
Channel::JoinUser() and Channel::ForceChan() changes
Convert static Channel::ForceChan() to non-static Channel::ForceJoin() that joins a user to a channel, no permission checks The (static) Channel::JoinUser() now has a LocalUser parameter, and no longer have TS and bursting parameters. If the channel doesn't exist, it is created using current time as TS
Diffstat (limited to 'src/modules/m_conn_join.cpp')
-rw-r--r--src/modules/m_conn_join.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/modules/m_conn_join.cpp b/src/modules/m_conn_join.cpp
index 7ba2b0c7d..113e49dff 100644
--- a/src/modules/m_conn_join.cpp
+++ b/src/modules/m_conn_join.cpp
@@ -45,19 +45,20 @@ class ModuleConnJoin : public Module
void OnPostConnect(User* user)
{
- if (!IS_LOCAL(user))
+ LocalUser* localuser = IS_LOCAL(user);
+ if (!localuser)
return;
std::string chanlist = ServerInstance->Config->ConfValue("autojoin")->getString("channel");
- chanlist = user->GetClass()->config->getString("autojoin", chanlist);
+ chanlist = localuser->GetClass()->config->getString("autojoin", chanlist);
irc::commasepstream chans(chanlist);
std::string chan;
while (chans.GetToken(chan))
{
- if (ServerInstance->IsChannel(chan.c_str(), ServerInstance->Config->Limits.ChanMax))
- Channel::JoinUser(user, chan, false, "", false, ServerInstance->Time());
+ if (ServerInstance->IsChannel(chan, ServerInstance->Config->Limits.ChanMax))
+ Channel::JoinUser(localuser, chan);
}
}
};