diff options
| author | 2013-04-12 16:00:17 +0200 | |
|---|---|---|
| committer | 2013-04-13 16:05:54 +0200 | |
| commit | b98acac5c91ecb08da28d70185818a19991eb1db (patch) | |
| tree | a72446ebf241ced2b21939eb8adb7a0045274dfe /src/modules/m_ojoin.cpp | |
| parent | OnUserPreJoin 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_ojoin.cpp')
| -rw-r--r-- | src/modules/m_ojoin.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/modules/m_ojoin.cpp b/src/modules/m_ojoin.cpp index 5ac67a649..3c9e84f3d 100644 --- a/src/modules/m_ojoin.cpp +++ b/src/modules/m_ojoin.cpp @@ -45,28 +45,30 @@ bool op; /** Handle /OJOIN */ -class CommandOjoin : public Command +class CommandOjoin : public SplitCommand { public: bool active; - CommandOjoin(Module* parent) : Command(parent,"OJOIN", 1) + CommandOjoin(Module* parent) : + SplitCommand(parent, "OJOIN", 1) { flags_needed = 'o'; Penalty = 0; syntax = "<channel>"; active = false; TRANSLATE3(TR_NICK, TR_TEXT, TR_END); } - CmdResult Handle (const std::vector<std::string>& parameters, User *user) + CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) { // Make sure the channel name is allowable. - if (!ServerInstance->IsChannel(parameters[0].c_str(), ServerInstance->Config->Limits.ChanMax)) + if (!ServerInstance->IsChannel(parameters[0], ServerInstance->Config->Limits.ChanMax)) { user->WriteServ("NOTICE "+user->nick+" :*** Invalid characters in channel name or name too long"); return CMD_FAILURE; } active = true; - Channel* channel = Channel::JoinUser(user, parameters[0].c_str(), false, "", false); + // override is false because we want OnUserPreJoin to run + Channel* channel = Channel::JoinUser(user, parameters[0], false); active = false; if (channel) |
