mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
Backport r9219-9220 from trunk. Override on operjoin, for those cases where operchans and operoverride will not satisfy your needs.
git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@9221 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
e735a5b28f
commit
2c5b062d55
@ -1783,9 +1783,15 @@
|
||||
#
|
||||
#-#-#-#-#-#-#-#-#-#-# OPERJOIN CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#
|
||||
# #
|
||||
# If you are using the m_operjoin.so module, specify the channel here #
|
||||
# If you are using the m_operjoin.so module, specify options here: #
|
||||
# #
|
||||
#<operjoin channel="#channel">
|
||||
# channel - The channel name to join, can also be a comma #
|
||||
# seperated list eg. "#channel1,#channel2". #
|
||||
# #
|
||||
# override - Lets the oper join walking thru any modes that #
|
||||
# might be set, even bans. Use "yes" or "no". #
|
||||
# #
|
||||
#<operjoin channel="#channel" override="no">
|
||||
|
||||
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
||||
# Oper levels module: Gives each oper a level and prevents
|
||||
|
@ -22,7 +22,8 @@ class ModuleOperjoin : public Module
|
||||
{
|
||||
private:
|
||||
std::string operChan;
|
||||
std::vector<std::string> operChans;
|
||||
std::vector<std::string> operChans;
|
||||
bool override;
|
||||
|
||||
int tokenize(const string &str, std::vector<std::string> &tokens)
|
||||
{
|
||||
@ -57,8 +58,9 @@ class ModuleOperjoin : public Module
|
||||
virtual void OnRehash(userrec* user, const std::string ¶meter)
|
||||
{
|
||||
ConfigReader* conf = new ConfigReader(ServerInstance);
|
||||
|
||||
|
||||
operChan = conf->ReadValue("operjoin", "channel", 0);
|
||||
override = conf->ReadFlag("operjoin", "override", "0", 0);
|
||||
operChans.clear();
|
||||
if (!operChan.empty())
|
||||
tokenize(operChan,operChans);
|
||||
@ -82,7 +84,7 @@ class ModuleOperjoin : public Module
|
||||
|
||||
for(std::vector<std::string>::iterator it = operChans.begin(); it != operChans.end(); it++)
|
||||
if (ServerInstance->IsChannel(it->c_str()))
|
||||
chanrec::JoinUser(ServerInstance, user, it->c_str(), false, "", ServerInstance->Time(true));
|
||||
chanrec::JoinUser(ServerInstance, user, it->c_str(), override, "", ServerInstance->Time(true));
|
||||
}
|
||||
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user