diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/channels.cpp | 18 | ||||
-rw-r--r-- | src/config.cpp | 11 | ||||
-rw-r--r-- | src/logger.cpp | 2 |
3 files changed, 22 insertions, 9 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index eca0bdd34..26623c24d 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -833,11 +833,13 @@ void Channel::SetModes(BotInfo *bi, bool EnforceMLock, const char *cmodes, ...) * @param ac Number of args * @param av args */ -void ChanSetInternalModes(Channel *c, int ac, const char **av) +void ChanSetInternalModes(Channel *c, int ac, const char **av, User *setter) { if (!ac) return; + Anope::string modestring; + Anope::string paramstring; int k = 0, j = 0, add = -1; for (unsigned int i = 0, end = strlen(av[0]); i < end; ++i) { @@ -846,9 +848,11 @@ void ChanSetInternalModes(Channel *c, int ac, const char **av) switch (av[0][i]) { case '+': + modestring += '+'; add = 1; continue; case '-': + modestring += '-'; add = 0; continue; default: @@ -857,6 +861,7 @@ void ChanSetInternalModes(Channel *c, int ac, const char **av) cm = ModeManager::FindChannelModeByChar(av[0][i]); if (!cm) continue; + modestring += cm->ModeChar; } if (cm->Type == MODE_REGULAR) @@ -880,6 +885,11 @@ void ChanSetInternalModes(Channel *c, int ac, const char **av) } if (++j < ac) { + User *u = NULL; + if (cm->Type == MODE_STATUS && (u = finduser(av[j]))) + paramstring += " " + u->nick; + else + paramstring += " " + Anope::string(av[j]); if (add) c->SetModeInternal(cm, av[j]); else @@ -889,6 +899,9 @@ void ChanSetInternalModes(Channel *c, int ac, const char **av) Log() << "warning: ChanSetInternalModes() recieved more modes requiring params than params, modes: " << merge_args(ac, av) << ", ac: " << ac << ", j: " << j; } + if (setter) + Log(setter, c, "mode") << modestring << paramstring; + if (j + k + 1 < ac) Log() << "warning: ChanSetInternalModes() recieved more params than modes requiring them, modes: " << merge_args(ac, av) << ", ac: " << ac << ", j: " << j << " k: " << k; } @@ -1311,9 +1324,6 @@ void do_cmode(const Anope::string &source, int ac, const char **av) --ac; ++av; - User *u = finduser(source); - if (u) - Log(u, c, "mode") << merge_args(ac, av); ChanSetInternalModes(c, ac, av); } diff --git a/src/config.cpp b/src/config.cpp index 7aa90947a..e692682b8 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -620,7 +620,7 @@ bool ValidateOperServ(ServerConfig *config, const Anope::string &tag, const Anop { if (!config->s_OperServ.empty()) { - if ((value.equals_ci("description") || value.equals_ci("globalnick") || value.equals_ci("globaldescription")) && data.GetValue().empty()) + if (value.equals_ci("description") && data.GetValue().empty()) throw ConfigException("The value for <" + tag + ":" + value + "> cannot be empty when OperServ is enabled!"); else if (value.equals_ci("autokillexpiry") || value.equals_ci("chankillexpiry") || value.equals_ci("snlineexpiry") || value.equals_ci("szlineexpiry") || value.equals_ci("sqlineexpiry")) return ValidateNotZero(config, tag, value, data); @@ -632,8 +632,11 @@ bool ValidateOperServ(ServerConfig *config, const Anope::string &tag, const Anop bool ValidateGlobal(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data) { - if (!config->s_GlobalNoticer.empty() && config->desc_GlobalNoticer.empty()) - throw ConfigException("The value for <" + tag + ":" + value + "> cannot be empty when Global is enabled!"); + if (!config->s_GlobalNoticer.empty()) + { + if (value.equals_ci("description") && data.GetValue().empty()) + throw ConfigException("The value for <" + tag + ":" + value + "> cannot be empty when Global is enabled!"); + } return true; } @@ -1178,7 +1181,7 @@ void ServerConfig::Read() {"operserv", "addakiller", "no", new ValueContainerBool(&this->AddAkiller), DT_BOOLEAN, NoValidation}, {"operserv", "opersonly", "no", new ValueContainerBool(&this->OSOpersOnly), DT_BOOLEAN, NoValidation}, {"global", "nick", "", new ValueContainerString(&this->s_GlobalNoticer), DT_STRING | DT_NORELOAD, NoValidation}, - {"global", "description", "Global Noticer", new ValueContainerString(&this->desc_GlobalNoticer), DT_STRING | DT_NORELOAD, ValidateGlobal}, + {"global", "description", "Global Noticer", new ValueContainerString(&this->desc_GlobalNoticer), DT_STRING | DT_NORELOAD, ValidateGlobal}, {"defcon", "defaultlevel", "0", new ValueContainerInt(&DefConLevel), DT_INTEGER, ValidateDefCon}, {"defcon", "level4", "", new ValueContainerString(&DefCon4), DT_STRING, ValidateDefCon}, {"defcon", "level3", "", new ValueContainerString(&DefCon3), DT_STRING, ValidateDefCon}, diff --git a/src/logger.cpp b/src/logger.cpp index d5982c3c7..33ed3545a 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -143,7 +143,7 @@ Log::Log(User *u, Channel *c, const Anope::string &category) : Type(LOG_CHANNEL) if (!c) throw CoreException("Invalid pointers passed to Log::Log"); - this->bi = whosends(c->ci); + this->bi = ChanServ; this->Category = category; if (this->bi) this->Sources.push_back(this->bi->nick); |