enableAutoFix = atob(chanfixConfig->Require("enableAutoFix")->second) ;
enableChanFix = atob(chanfixConfig->Require("enableChanFix")->second) ;
enableChannelBlocking = atob(chanfixConfig->Require("enableChannelBlocking")->second) ;
+autoFixNotice = atob(chanfixConfig->Require("autoFixNotice")->second) ;
+manualFixNotice = atob(chanfixConfig->Require("manualFixNotice")->second) ;
joinChannels = atob(chanfixConfig->Require("joinChannels")->second) ;
stopAutoFixOnOp = atob(chanfixConfig->Require("stopAutoFixOnOp")->second) ;
stopChanFixOnOp = atob(chanfixConfig->Require("stopChanFixOnOp")->second) ;
{
/* if (currentState != RUN) return; */
-/* COMMENTED OUT DUE TO isService() NOT IN CORE YET
- * TODO: make sure that we ignore ops to C from servers (ie when it joins on a fix)
- * assuming that joinchannel triggers this.
- * if (theUser) {
- * // Let's see what server did the mode
- * iServer* theServer = Network->findServer(theUser->getClient()->getIntYY());
- * // If it was a service, then add the channel to the block list.
- * if (theServer && theServer != MyUplink->getUplink() && theServer->isService()) {
- * // Check if it isn't already in the block list. If not, add it.
- * if (!isTempBlocked(theChan->getName()))
- * tempBlockList.insert(tempBlockType::value_type(theChan->getName(), currentTime()));
- * }
- * }
- */
+if (theUser) {
+ iServer* theServer = Network->findServer(theUser->getClient()->getIntYY());
+ if (theServer && theServer != MyUplink->getUplink() && theServer->isService()) {
+ if (!isTempBlocked(theChan->getName()))
+ tempBlockList.insert(tempBlockType::value_type(theChan->getName(), currentTime()));
+ }
+}
+
if (theChan->size() < minClients)
return;
void chanfix::PartChan(Channel* theChan)
{
-MyUplink->PartChannel(this, theChan->getName(), "Channel Fixed");
+MyUplink->PartChannel(this, theChan->getName(), "");
}
/* Check for the channel service server to see if it is linked. */
autoFixQ.insert(fixQueueType::value_type(thisChan->getName(), currentTime()));
numOpLess++;
- if (doJoinChannels()) {
+ if (doJoinChannels())
JoinChan(thisChan);
- Message(thisChan, "Channel fix in progress, please stand by.");
- }
+ if (doAutoFixNotice())
+ Message(thisChan, "Automatic channel fix in progress, please stand by.");
}
}
}
if (doJoinChannels())
JoinChan(thisChan);
-
-Message(thisChan, "Channel fix in progress, please stand by.");
+if (doManualFixNotice())
+ Message(thisChan, "Channel fix in progress, please stand by.");
manFixQ.insert(fixQueueType::value_type(thisChan->getName(), currentTime() + CHANFIX_DELAY));
}
if (!theChan) return;
bool inFix = false;
+int type = 0;
if ((stopAutoFixOnOp || force) && isBeingAutoFixed(theChan)) {
+ type = 1;
inFix = true;
removeFromAutoQ(theChan);
}
if ((stopChanFixOnOp || force) && isBeingChanFixed(theChan)) {
+ type = 2;
inFix = true;
removeFromManQ(theChan);
}
}
}
+if ((type == 1) && (doAutoFixNotice()))
+ Message(theChan, "Channel has been automatically fixed.");
+else if ((type == 2) && (doManualFixNotice()))
+ Message(theChan, "Channel has been fixed.");
+
if (doJoinChannels())
PartChan(theChan);
*/
if (isFixed || currentTime() - sqlChan->getFixStart() > AUTOFIX_MAXIMUM) {
Channel* theChan = Network->findChannel(sqlChan->getChannel());
+ if (doAutoFixNotice())
+ Message(theChan, "Channel has been automatically fixed.");
if (doJoinChannels())
PartChan(theChan);
autoFixQ.erase(ptr++);
*/
if (isFixed || currentTime() - sqlChan->getFixStart() > CHANFIX_MAXIMUM + CHANFIX_DELAY) {
Channel* theChan = Network->findChannel(sqlChan->getChannel());
+ if (doManualFixNotice())
+ Message(theChan, "Channel has been fixed.");
if (doJoinChannels())
PartChan(theChan);
manFixQ.erase(ptr++);
bool enableChanFix;
bool enableChannelBlocking;
bool joinChannels;
+ bool autoFixNotice;
+ bool manualFixNotice;
bool stopAutoFixOnOp;
bool stopChanFixOnOp;
bool allowTopOpFix;
bool doChanFix() { return enableChanFix; }
bool doChanBlocking() { return enableChannelBlocking; }
bool doJoinChannels() { return joinChannels; }
+ bool doAutoFixNotice() { return autoFixNotice; }
+ bool doManualFixNotice() { return manualFixNotice; }
STATE getState() { return currentState; }
bool isChanServLinked() { return chanServLinked; }
bool isUpdateRunning() { return updateInProgress; }
{ enableChanFix = _enableChanFix; }
inline void setDoChanBlocking(bool _enableChannelBlocking)
{ enableChannelBlocking = _enableChannelBlocking; }
- inline void setJoinChannels(bool _joinChannels)
- { joinChannels = _joinChannels; }
inline void setCurrentDay()
{ currentDay = currentTime() / 86400 % DAYSAMPLES; }