mirror of
https://github.com/anope/anope.git
synced 2026-07-09 09:23:13 +02:00
Moved the language strings which are only used once
out of the core and into the modules that use them.
This commit is contained in:
+38
-33
@@ -47,9 +47,9 @@ class CommandCSInfo : public Command
|
||||
if (ci->HasFlag(CI_FORBIDDEN))
|
||||
{
|
||||
if (u->HasMode(UMODE_OPER) && !ci->forbidby.empty())
|
||||
source.Reply(CHAN_X_FORBIDDEN_OPER, chan.c_str(), ci->forbidby.c_str(), !ci->forbidreason.empty() ? ci->forbidreason.c_str() : GetString(u, NO_REASON).c_str());
|
||||
source.Reply(LanguageString::CHAN_X_FORBIDDEN_OPER, chan.c_str(), ci->forbidby.c_str(), !ci->forbidreason.empty() ? ci->forbidreason.c_str() : GetString(u->Account(), LanguageString::NO_REASON).c_str());
|
||||
else
|
||||
source.Reply(CHAN_X_FORBIDDEN, chan.c_str());
|
||||
source.Reply(LanguageString::CHAN_X_FORBIDDEN, chan.c_str());
|
||||
|
||||
return MOD_CONT;
|
||||
}
|
||||
@@ -58,55 +58,55 @@ class CommandCSInfo : public Command
|
||||
if (has_auspex || check_access(u, ci, CA_INFO))
|
||||
show_all = true;
|
||||
|
||||
source.Reply(CHAN_INFO_HEADER, chan.c_str());
|
||||
source.Reply(CHAN_INFO_NO_FOUNDER, ci->founder->display.c_str());
|
||||
source.Reply(LanguageString::CHAN_INFO_HEADER, chan.c_str());
|
||||
source.Reply(_(" Founder: %s"), ci->founder->display.c_str());
|
||||
|
||||
if (show_all && ci->successor)
|
||||
source.Reply(CHAN_INFO_NO_SUCCESSOR, ci->successor->display.c_str());
|
||||
source.Reply(_(" Successor: %s"), ci->successor->display.c_str());
|
||||
|
||||
source.Reply(CHAN_INFO_DESCRIPTION, ci->desc.c_str());
|
||||
source.Reply(CHAN_INFO_TIME_REGGED, do_strftime(ci->time_registered).c_str());
|
||||
source.Reply(CHAN_INFO_LAST_USED, do_strftime(ci->last_used).c_str());
|
||||
source.Reply(_(" Description: %s"), ci->desc.c_str());
|
||||
source.Reply(_(" Registered: %s"), do_strftime(ci->time_registered).c_str());
|
||||
source.Reply(_(" Last used: %s"), do_strftime(ci->last_used).c_str());
|
||||
|
||||
ModeLock *secret = ci->GetMLock(CMODE_SECRET);
|
||||
if (!ci->last_topic.empty() && (show_all || ((!secret || secret->set == false) && (!ci->c || !ci->c->HasMode(CMODE_SECRET)))))
|
||||
{
|
||||
source.Reply(CHAN_INFO_LAST_TOPIC, ci->last_topic.c_str());
|
||||
source.Reply(CHAN_INFO_TOPIC_SET_BY, ci->last_topic_setter.c_str());
|
||||
source.Reply(_(" Last topic: %s"), ci->last_topic.c_str());
|
||||
source.Reply(_(" Topic set by: %s"), ci->last_topic_setter.c_str());
|
||||
}
|
||||
|
||||
if (show_all)
|
||||
{
|
||||
source.Reply(CHAN_INFO_BANTYPE, ci->bantype);
|
||||
source.Reply(_(" Ban type: %d"), ci->bantype);
|
||||
Anope::string optbuf;
|
||||
|
||||
CheckOptStr(optbuf, CI_KEEPTOPIC, GetString(u, CHAN_INFO_OPT_KEEPTOPIC), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_OPNOTICE, GetString(u, CHAN_INFO_OPT_OPNOTICE), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_PEACE, GetString(u, CHAN_INFO_OPT_PEACE), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_PRIVATE, GetString(u, NICK_INFO_OPT_PRIVATE), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_RESTRICTED, GetString(u, CHAN_INFO_OPT_RESTRICTED), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_SECURE, GetString(u, CHAN_INFO_OPT_SECURE), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_SECUREFOUNDER, GetString(u, CHAN_INFO_OPT_SECUREFOUNDER), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_SECUREOPS, GetString(u, CHAN_INFO_OPT_SECUREOPS), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_KEEPTOPIC, GetString(u->Account(), _("Topic Retention")), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_OPNOTICE, GetString(u->Account(), _("OP Notice")), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_PEACE, GetString(u->Account(), _("Peace")), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_PRIVATE, GetString(u->Account(), _("Private")), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_RESTRICTED, GetString(u->Account(), _("Restricted Access")), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_SECURE, GetString(u->Account(), _("Secure")), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_SECUREFOUNDER, GetString(u->Account(), _("Secure Founder")), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_SECUREOPS, GetString(u->Account(), _("Secure Ops")), ci, u->Account());
|
||||
if (ci->HasFlag(CI_SIGNKICK))
|
||||
CheckOptStr(optbuf, CI_SIGNKICK, GetString(u, CHAN_INFO_OPT_SIGNKICK), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_SIGNKICK, GetString(u->Account(), _("Signed kicks")), ci, u->Account());
|
||||
else
|
||||
CheckOptStr(optbuf, CI_SIGNKICK_LEVEL, GetString(u, CHAN_INFO_OPT_SIGNKICK), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_TOPICLOCK, GetString(u, CHAN_INFO_OPT_TOPICLOCK), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_XOP, GetString(u, CHAN_INFO_OPT_XOP), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_PERSIST, GetString(u, CHAN_INFO_OPT_PERSIST), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_SIGNKICK_LEVEL, GetString(u->Account(), _("Signed kicks")), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_TOPICLOCK, GetString(u->Account(), _("Topic Lock")), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_XOP, GetString(u->Account(), _("xOP lists system")), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_PERSIST, GetString(u->Account(), _("Persistant")), ci, u->Account());
|
||||
|
||||
source.Reply(NICK_INFO_OPTIONS, optbuf.empty() ? GetString(u, NICK_INFO_OPT_NONE).c_str() : optbuf.c_str());
|
||||
source.Reply(CHAN_INFO_MODE_LOCK, get_mlock_modes(ci, 1).c_str());
|
||||
source.Reply(LanguageString::NICK_INFO_OPTIONS, optbuf.empty() ? _("None") : optbuf.c_str());
|
||||
source.Reply(_(" Mode lock: %s"), get_mlock_modes(ci, 1).c_str());
|
||||
|
||||
// XXX: we could just as easily (and tidily) merge this in with the flags display above.
|
||||
if (ci->HasFlag(CI_NO_EXPIRE))
|
||||
source.Reply(CHAN_INFO_NO_EXPIRE);
|
||||
source.Reply(_("This channel will not expire."));
|
||||
else
|
||||
source.Reply(CHAN_INFO_EXPIRE, do_strftime(ci->last_used + Config->CSExpire).c_str());
|
||||
source.Reply(_(" Expires on: %s"), do_strftime(ci->last_used + Config->CSExpire).c_str());
|
||||
}
|
||||
if (ci->HasFlag(CI_SUSPENDED))
|
||||
source.Reply(CHAN_X_SUSPENDED, ci->forbidby.c_str(), !ci->forbidreason.empty() ? ci->forbidreason.c_str() : GetString(u, NO_REASON).c_str());
|
||||
source.Reply(_(" Suspended: [%s] %s"), ci->forbidby.c_str(), !ci->forbidreason.empty() ? ci->forbidreason.c_str() : GetString(u->Account(), LanguageString::NO_REASON).c_str());
|
||||
|
||||
FOREACH_MOD(I_OnChanInfo, OnChanInfo(u, ci, show_all));
|
||||
|
||||
@@ -115,19 +115,24 @@ class CommandCSInfo : public Command
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
|
||||
{
|
||||
source.Reply(CHAN_HELP_INFO);
|
||||
|
||||
source.Reply(_("Syntax: \002INFO \037channel\037\002\n"
|
||||
" \n"
|
||||
"Lists information about the named registered channel,\n"
|
||||
"including its founder, time of registration, last time\n"
|
||||
"used, description, and mode lock, if any. If \002ALL\002 is \n"
|
||||
"specified, the entry message and successor will also \n"
|
||||
"be displayed."));
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
|
||||
{
|
||||
SyntaxError(source, "INFO", CHAN_INFO_SYNTAX);
|
||||
SyntaxError(source, "INFO", _("INFO \037channel\037"));
|
||||
}
|
||||
|
||||
void OnServHelp(CommandSource &source)
|
||||
{
|
||||
source.Reply(CHAN_HELP_CMD_INFO);
|
||||
source.Reply(_(" INFO Lists information about the named registered channel"));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user