diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-05-27 12:02:10 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-05-27 12:02:10 +0000 |
commit | 4a50237d63ae019fbfaf0901ef59a772e66080df (patch) | |
tree | f4282f212cb5eb805919e8f12ae52f0e07e53421 /src/channels.cpp | |
parent | 140b01ba4927e7d6b85504ff740ae443b0f2df2a (diff) |
Config option for default channel modes -- more to follow, don't use yet
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7163 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/channels.cpp')
-rw-r--r-- | src/channels.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 11a5c944d..7ed166982 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -172,6 +172,23 @@ CUList* chanrec::GetVoicedUsers() return &internal_voice_userlist; } +void chanrec::SetDefaultModes() +{ + irc::spacesepstream list(ServerInstance->Config->DefaultModes); + std::string modeseq = list.GetToken(); + + for (std::string::iterator n = modeseq.begin(); n != modeseq.end(); ++n) + { + ModeHandler* mode = ServerInstance->Modes->FindMode(*n, MODETYPE_CHANNEL); + if (mode) + { + this->SetMode(*n, true); + if (mode->GetNumParams(true)) + this->SetModeParam(*n, list.GetToken().c_str(), true); + } + } +} + /* * add a channel to a user, creating the record for it if needed and linking * it to the user record @@ -213,7 +230,7 @@ chanrec* chanrec::JoinUser(InspIRCd* Instance, userrec *user, const char* cn, bo /* As spotted by jilles, dont bother to set this on remote users */ if (IS_LOCAL(user)) - Ptr->modes[CM_TOPICLOCK] = Ptr->modes[CM_NOEXTERNAL] = 1; + Ptr->SetDefaultModes(); Ptr->created = TS ? TS : Instance->Time(); Ptr->age = Ptr->created; |