1
0
mirror of https://github.com/anope/anope.git synced 2026-07-08 03: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:
Adam
2011-02-04 15:30:31 -05:00
parent c362a1e077
commit 08583dc107
226 changed files with 42289 additions and 45412 deletions
+2 -2
View File
@@ -220,7 +220,7 @@ find_package(Gettext)
option(USE_RUN_CC_PL "Use run-cc.pl for building" OFF)
# Use the following directories as includes
include_directories(${Anope_SOURCE_DIR}/include ${Anope_BINARY_DIR}/include ${Anope_BINARY_DIR}/lang)
include_directories(${Anope_SOURCE_DIR}/include ${Anope_BINARY_DIR}/include ${Anope_BINARY_DIR}/language)
# If using Windows, always add the _WIN32 define
if(WIN32)
@@ -449,7 +449,7 @@ endif(${Anope_SOURCE_DIR} STREQUAL ${Anope_BINARY_DIR})
# Go into the following directories and run their CMakeLists.txt as well
add_subdirectory(data)
add_subdirectory(docs)
add_subdirectory(lang)
add_subdirectory(language)
add_subdirectory(src)
add_subdirectory(modules)
add_subdirectory(include)
+1 -1
View File
@@ -71,8 +71,8 @@ struct CoreExport CommandSource
~CommandSource();
void Reply(LanguageString message, ...);
void Reply(const char *message, ...);
void Reply(const Anope::string &message);
};
/** Every services command is a class, inheriting from Command.
+7 -8
View File
@@ -53,7 +53,7 @@ E BotInfo *findbot(const Anope::string &nick);
E Anope::string normalizeBuffer(const Anope::string &);
E void check_ban(ChannelInfo *ci, User *u, int ttbtype);
E void bot_kick(ChannelInfo *ci, User *u, LanguageString message, ...);
E void bot_kick(ChannelInfo *ci, User *u, const char *message, ...);
E void bot_raw_ban(User *requester, ChannelInfo *ci, const Anope::string &nick, const Anope::string &reason);
E void bot_raw_kick(User *requester, ChannelInfo *ci, const Anope::string &nick, const Anope::string &reason);
@@ -140,13 +140,12 @@ E void pmodule_ircd_message(IRCdMessage *message);
/**** language.cpp ****/
E std::vector<Anope::string> languages;
E void InitLanguages();
E const Anope::string GetString(const Anope::string &language, LanguageString string);
E const Anope::string GetString(LanguageString string);
E const Anope::string GetString(NickCore *nc, LanguageString string);
E const Anope::string GetString(User *u, LanguageString string);
E const Anope::string GetString(const char *domain, Anope::string language, const Anope::string &string);
E const char *const language_strings[LANG_STRING_COUNT];
E void SyntaxError(CommandSource &source, const Anope::string &command, LanguageString message);
E const Anope::string GetString(NickCore *nc, const char *string);
E const Anope::string GetString(const Anope::string &domain, const Anope::string &lang, const char *string);
E void PushLanguage(const Anope::string &, Anope::string);
E void PopLanguage();
E const char *anope_gettext(const char *string);
E void SyntaxError(CommandSource &source, const Anope::string &command, const Anope::string &message);
/*** logger.cpp ***/
E void InitLogChannels(ServerConfig *);
+119 -1577
View File
File diff suppressed because it is too large Load Diff
-1
View File
@@ -4,6 +4,5 @@
#include "services.h"
#include "commands.h"
#include "modules.h"
#define _(x) x
#endif // MODULE_H
-3
View File
@@ -118,10 +118,7 @@ class patricia_tree
}
if (place != prev)
{
prev->up = newelem;
newelem->up = place;
}
if (place)
{
+10 -3
View File
@@ -140,6 +140,13 @@ extern "C" void __pfnBkCheck() {}
# undef int32
#endif
#if GETTEXT_FOUND
# include LIBINTL
# define _(x) anope_gettext(x)
#else
# define _(x) x
#endif
/** This definition is used as shorthand for the various classes
* and functions needed to make a module loadable by the OS.
* It defines the class factory and external AnopeInit and AnopeFini functions.
@@ -776,7 +783,6 @@ enum
* user is kicked.
*/
#include "language.h"
#include "users.h"
#include "account.h"
#include "bots.h"
@@ -792,7 +798,7 @@ struct LevelInfo
{
int what;
Anope::string name;
LanguageString desc;
const char *desc;
};
#include "channels.h"
@@ -852,7 +858,7 @@ struct NewsMessages
{
NewsType type;
Anope::string name;
LanguageString msgs[10];
const char *msgs[10];
};
struct NewsItem
@@ -938,6 +944,7 @@ struct Uplink;
class ServerConfig;
#include "extern.h"
#include "language.h"
#include "operserv.h"
#include "mail.h"
#include "servers.h"
-7
View File
@@ -158,13 +158,6 @@ class CoreExport User : public Extensible
void SendMessage(BotInfo *source, const char *fmt, ...);
virtual void SendMessage(BotInfo *source, const Anope::string &msg);
/** Send a language string message to a user
* @param source Sender
* @param message The message num
* @param ... parameters
*/
void SendMessage(BotInfo *source, LanguageString message, ...);
/** Collide a nick
* See the comment in users.cpp
* @param na The nick
-6
View File
@@ -1,6 +0,0 @@
#!/bin/bash
HLANG=`cat ../include/language.h | grep "^\s" | sed 's/[\t,]//g'`
CPPLANG=`cat ../src/language.cpp | grep "\s\/\* [A-Z0-9_]* \*\/" | sed 's/\/\* \(.*\) \*\//\1/' | sed 's/\t//'`
echo "${HLANG} ${CPPLANG}" | sed 's/ /\n/' | sort | uniq -u
-10
View File
@@ -1,10 +0,0 @@
#!/bin/bash
for string in `egrep "^.+[A-Z]+," ../include/language.h | sed "s/\t\(.*\),/\1/"` ; do
CMD=`grep -RI $string {../src,../modules,../include} | grep -v "language\.cpp:.*\/\* $string" | grep -v "language\.h:"`
if [ ! -n "$CMD" ] ; then
echo "$string is unused"
sed -i "s/\/\* $string \*\//\/* $string - UNUSED *\//" ../src/language.cpp
sed -i "/$string,/d" ../include/language.h
fi
done
-10
View File
@@ -1,10 +0,0 @@
#!/bin/bash
pushd ../src > /dev/null
xgettext -C -s -d Anope -o ../lang/anope.pot --from-code=utf-8 --keyword=_ language.cpp
popd > /dev/null
for f in *.po
do
msgmerge -v -s -U $f `echo $f | cut -d'.' -f1`.pot
done
@@ -24,7 +24,6 @@ if(GETTEXT_FOUND)
MAIN_DEPENDENCY ${LANG_PO}
)
# Add to cpack ignored files if not on Windows.
file(RELATIVE_PATH LANG_RELATIVE ${Anope_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/${LANG_LANG})
if(NOT WIN32)
add_to_cpack_ignored_files("${LANG_MO}")
endif(NOT WIN32)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
rm anope.pot
touch anope.pot
cd ..
FILES=`find ./ -name *.cpp -o -name *.h | grep -v /modules/extra/`
for f in $FILES
do
xgettext -C -s -d Anope -j -o language/anope.pot --from-code=utf-8 --keyword=_ $f
done
cd -
for f in *.po
do
msgmerge -v -s -U $f `echo $f | cut -d'.' -f1`.pot
done
rm -f *~
+5 -2
View File
@@ -1,3 +1,5 @@
add_subdirectory("extra/language")
# Get a list of ALL files and directories within the current directory
file(GLOB MODULES_FOLDERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*")
remove_item_from_list(MODULES_FOLDERS "CMakeFiles")
@@ -75,7 +77,7 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS})
set(WIN32_NO_LIBS)
endif(WIN32)
set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${TEMP_LDFLAGS} ${WIN32_NO_LIBS}")
add_dependencies(${SO} ${PROGRAM_NAME})
add_dependencies(${SO} ${PROGRAM_NAME} module_language)
# For Windows only, have the module link to the export library of Anope as well as wsock32 and Ws2_32 libraries (most of the modules probably don't need this, but this is to be on the safe side), also set it's version
if(WIN32)
target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 Ws2_32 ${WIN32_MEMORY} ${TEMP_DEPENDENCIES})
@@ -92,6 +94,7 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS})
# Get a list of ALL files and directories within this modules directory
file(GLOB SUBMODULE_DIRS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${MODULE_FOLDER}/*")
remove_item_from_list(SUBMODULE_DIRS "CMakeFiles")
remove_item_from_list(SUBMODULE_DIRS "extra/language")
foreach(SUBDIR ${SUBMODULE_DIRS})
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIR}")
@@ -169,7 +172,7 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS})
# Generate the module and set it's linker flags, also set it to depend on the main Anope executable to be built beforehand
add_library(${SO} MODULE ${MODULES_SUBDIR_SRCS})
set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${SUBDIR_LDFLAGS}")
add_dependencies(${SO} ${PROGRAM_NAME})
add_dependencies(${SO} ${PROGRAM_NAME} module_language)
# For Windows only, have the module link to the export library of Anope as well as wsock32 and Ws2_32 libraries (most of the modules probably don't need this, but this is to be on the safe side), also set it's version
if(WIN32)
target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 Ws2_32 ${WIN32_MEMORY} ${SUBDIR_EXTRA_DEPENDS})
+9 -6
View File
@@ -28,19 +28,19 @@ class CommandBSAct : public Command
if (!check_access(u, ci, CA_SAY))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
if (!ci->bi)
{
source.Reply(BOT_NOT_ASSIGNED);
source.Reply(LanguageString::BOT_NOT_ASSIGNED);
return MOD_CONT;
}
if (!ci->c || !ci->c->FindUser(ci->bi))
{
source.Reply(BOT_NOT_ON_CHANNEL, ci->name.c_str());
source.Reply(LanguageString::BOT_NOT_ON_CHANNEL, ci->name.c_str());
return MOD_CONT;
}
@@ -59,18 +59,21 @@ class CommandBSAct : public Command
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "ACT", BOT_ACT_SYNTAX);
SyntaxError(source, "ACT", _("ACT \037channel\037 \037text\037"));
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(BOT_HELP_ACT);
source.Reply(_("Syntax: \002ACT \037channel\037 \037text\037\002\n"
" \n"
"Makes the bot do the equivalent of a \"/me\" command\n"
"on the given channel using the given text."));
return true;
}
void OnServHelp(CommandSource &source)
{
source.Reply(BOT_HELP_CMD_ACT);
source.Reply(_(" ACT Makes the bot do the equivalent of a \"/me\" command"));
}
};
+13 -9
View File
@@ -29,32 +29,32 @@ class CommandBSAssign : public Command
if (readonly)
{
source.Reply(BOT_ASSIGN_READONLY);
source.Reply(LanguageString::BOT_ASSIGN_READONLY);
return MOD_CONT;
}
BotInfo *bi = findbot(nick);
if (!bi)
{
source.Reply(BOT_DOES_NOT_EXIST, nick.c_str());
source.Reply(LanguageString::BOT_DOES_NOT_EXIST, nick.c_str());
return MOD_CONT;
}
if (ci->botflags.HasFlag(BS_NOBOT) || (!check_access(u, ci, CA_ASSIGN) && !u->Account()->HasPriv("botserv/administration")))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
if (bi->HasFlag(BI_PRIVATE) && !u->Account()->HasCommand("botserv/assign/private"))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
if (ci->bi && nick.equals_ci(ci->bi->nick))
{
source.Reply(BOT_ASSIGN_ALREADY, ci->bi->nick.c_str(), chan.c_str());
source.Reply(_("Bot \002%s\002 is already assigned to channel \002%s\002."), ci->bi->nick.c_str(), chan.c_str());
return MOD_CONT;
}
@@ -62,24 +62,28 @@ class CommandBSAssign : public Command
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "for " << bi->nick;
bi->Assign(u, ci);
source.Reply(BOT_ASSIGN_ASSIGNED, bi->nick.c_str(), ci->name.c_str());
source.Reply(_("Bot \002%s\002 has been assigned to %s."), bi->nick.c_str(), ci->name.c_str());
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(BOT_HELP_ASSIGN);
source.Reply(_("Syntax: \002ASSIGN \037chan\037 \037nick\037\002\n"
" \n"
"Assigns a bot pointed out by nick to the channel chan. You\n"
"can then configure the bot for the channel so it fits\n"
"your needs."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "ASSIGN", BOT_ASSIGN_SYNTAX);
SyntaxError(source, "ASSIGN", _("ASSIGN \037chan\037 \037nick\037"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(BOT_HELP_CMD_ASSIGN);
source.Reply(_(" ASSIGN Assigns a bot to a channel"));
}
};
+55 -20
View File
@@ -25,7 +25,7 @@ class BadwordsListCallback : public NumberList
~BadwordsListCallback()
{
if (!SentHeader)
source.Reply(BOT_BADWORDS_NO_MATCH, source.ci->name.c_str());
source.Reply(_("No matching entries on %s bad words list."), source.ci->name.c_str());
}
void HandleNumber(unsigned Number)
@@ -36,7 +36,8 @@ class BadwordsListCallback : public NumberList
if (!SentHeader)
{
SentHeader = true;
source.Reply(BOT_BADWORDS_LIST_HEADER, source.ci->name.c_str());
source.Reply(_("Bad words list for %s:\n"
" Num Word Type"), source.ci->name.c_str());
}
DoList(source, Number - 1, source.ci->GetBadWord(Number - 1));
@@ -44,7 +45,7 @@ class BadwordsListCallback : public NumberList
static void DoList(CommandSource &source, unsigned Number, BadWord *bw)
{
source.Reply(BOT_BADWORDS_LIST_FORMAT, Number + 1, bw->word.c_str(), bw->type == BW_SINGLE ? "(SINGLE)" : (bw->type == BW_START ? "(START)" : (bw->type == BW_END ? "(END)" : "")));
source.Reply(_(" %3d %-30s %s"), Number + 1, bw->word.c_str(), bw->type == BW_SINGLE ? "(SINGLE)" : (bw->type == BW_START ? "(START)" : (bw->type == BW_END ? "(END)" : "")));
}
};
@@ -64,11 +65,11 @@ class BadwordsDelCallback : public NumberList
~BadwordsDelCallback()
{
if (!Deleted)
source.Reply(BOT_BADWORDS_NO_MATCH, source.ci->name.c_str());
source.Reply(_("No matching entries on %s bad words list."), source.ci->name.c_str());
else if (Deleted == 1)
source.Reply(BOT_BADWORDS_DELETED_ONE, source.ci->name.c_str());
source.Reply(_("Deleted 1 entry from %s bad words list."), source.ci->name.c_str());
else
source.Reply(BOT_BADWORDS_DELETED_SEVERAL, Deleted, source.ci->name.c_str());
source.Reply(_("Deleted %d entries from %s bad words list."), Deleted, source.ci->name.c_str());
}
void HandleNumber(unsigned Number)
@@ -92,7 +93,7 @@ class CommandBSBadwords : public Command
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source.u, this, ci) << "LIST";
if (!ci->GetBadWordCount())
source.Reply(BOT_BADWORDS_LIST_EMPTY, ci->name.c_str());
source.Reply(_("%s bad words list is empty."), ci->name.c_str());
else if (!word.empty() && word.find_first_not_of("1234567890,-") == Anope::string::npos)
{
BadwordsListCallback list(source, word);
@@ -112,14 +113,16 @@ class CommandBSBadwords : public Command
if (!SentHeader)
{
SentHeader = true;
source.Reply(BOT_BADWORDS_LIST_HEADER, ci->name.c_str());
source.Reply(_("Bad words list for %s:\n"
" Num Word Type"), ci->name.c_str());
}
BadwordsListCallback::DoList(source, i, bw);
}
if (!SentHeader)
source.Reply(BOT_BADWORDS_NO_MATCH, ci->name.c_str());
source.Reply(_("No matching entries on %s bad words list."), ci->name.c_str());
}
return MOD_CONT;
@@ -149,7 +152,7 @@ class CommandBSBadwords : public Command
if (ci->GetBadWordCount() >= Config->BSBadWordsMax)
{
source.Reply(BOT_BADWORDS_REACHED_LIMIT, Config->BSBadWordsMax);
source.Reply(_("Sorry, you can only have %d bad words entries on a channel."), Config->BSBadWordsMax);
return MOD_CONT;
}
@@ -159,7 +162,7 @@ class CommandBSBadwords : public Command
if (!bw->word.empty() && ((Config->BSCaseSensitive && realword.equals_cs(bw->word)) || (!Config->BSCaseSensitive && realword.equals_ci(bw->word))))
{
source.Reply(BOT_BADWORDS_ALREADY_EXISTS, bw->word.c_str(), ci->name.c_str());
source.Reply(_("\002%s\002 already exists in %s bad words list."), bw->word.c_str(), ci->name.c_str());
return MOD_CONT;
}
}
@@ -168,7 +171,7 @@ class CommandBSBadwords : public Command
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source.u, this, ci) << "ADD " << realword;
ci->AddBadWord(realword, type);
source.Reply(BOT_BADWORDS_ADDED, realword.c_str(), ci->name.c_str());
source.Reply(_("\002%s\002 added to %s bad words list."), realword.c_str(), ci->name.c_str());
return MOD_CONT;
}
@@ -197,7 +200,7 @@ class CommandBSBadwords : public Command
if (i == end)
{
source.Reply(BOT_BADWORDS_NOT_FOUND, word.c_str(), ci->name.c_str());
source.Reply(_("\002%s\002 not found on %s bad words list."), word.c_str(), ci->name.c_str());
return MOD_CONT;
}
@@ -205,7 +208,7 @@ class CommandBSBadwords : public Command
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source.u, this, ci) << "DEL " << badword->word;
ci->EraseBadWord(i);
source.Reply(BOT_BADWORDS_DELETED, badword->word.c_str(), ci->name.c_str());
source.Reply(_("\002%s\002 deleted from %s bad words list."), badword->word.c_str(), ci->name.c_str());
}
return MOD_CONT;
@@ -218,7 +221,7 @@ class CommandBSBadwords : public Command
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source.u, this, ci) << "CLEAR";
ci->ClearBadWords();
source.Reply(BOT_BADWORDS_CLEAR);
source.Reply(_("Bad words list is now empty."));
return MOD_CONT;
}
public:
@@ -242,13 +245,13 @@ class CommandBSBadwords : public Command
if (!check_access(u, ci, CA_BADWORDS) && (!need_args || !u->Account()->HasPriv("botserv/administration")))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
if (readonly)
{
source.Reply(BOT_BADWORDS_DISABLED);
source.Reply(_("Sorry, channel bad words list modification is temporarily disabled."));
return MOD_CONT;
}
@@ -268,18 +271,50 @@ class CommandBSBadwords : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(BOT_HELP_BADWORDS);
source.Reply(_("Syntax: \002BADWORDS \037channel\037 ADD \037word\037 [\037SINGLE\037 | \037START\037 | \037END\037]\002\n"
" \002BADWORDS \037channel\037 DEL {\037word\037 | \037entry-num\037 | \037list\037}\002\n"
" \002BADWORDS \037channel\037 LIST [\037mask\037 | \037list\037]\002\n"
" \002BADWORDS \037channel\037 CLEAR\002\n"
" \n"
"Maintains the \002bad words list\002 for a channel. The bad\n"
"words list determines which words are to be kicked\n"
"when the bad words kicker is enabled. For more information,\n"
"type \002%R%S HELP KICK BADWORDS\002.\n"
" \n"
"The \002BADWORDS ADD\002 command adds the given word to the\n"
"badword list. If SINGLE is specified, a kick will be\n"
"done only if a user says the entire word. If START is \n"
"specified, a kick will be done if a user says a word\n"
"that starts with \037word\037. If END is specified, a kick\n"
"will be done if a user says a word that ends with\n"
"\037word\037. If you don't specify anything, a kick will\n"
"be issued every time \037word\037 is said by a user.\n"
" \n"
"The \002BADWORDS DEL\002 command removes the given word from the\n"
"bad words list. If a list of entry numbers is given, those\n"
"entries are deleted. (See the example for LIST below.)\n"
" \n"
"The \002BADWORDS LIST\002 command displays the bad words list. If\n"
"a wildcard mask is given, only those entries matching the\n"
"mask are displayed. If a list of entry numbers is given,\n"
"only those entries are shown; for example:\n"
" \002BADWORDS #channel LIST 2-5,7-9\002\n"
" Lists bad words entries numbered 2 through 5 and\n"
" 7 through 9.\n"
" \n"
"The \002BADWORDS CLEAR\002 command clears all entries of the\n"
"bad words list."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "BADWORDS", BOT_BADWORDS_SYNTAX);
SyntaxError(source, "BADWORDS", _("BADWORDS \037channel\037 {ADD|DEL|LIST|CLEAR} [\037word\037 | \037entry-list\037] [SINGLE|START|END]"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(BOT_HELP_CMD_BADWORDS);
source.Reply(_(" BADWORDS Maintains bad words list"));
}
};
+57 -37
View File
@@ -26,60 +26,60 @@ class CommandBSBot : public Command
if (findbot(nick))
{
source.Reply(BOT_BOT_ALREADY_EXISTS, nick.c_str());
source.Reply(_("Bot \002%s\002 already exists."), nick.c_str());
return MOD_CONT;
}
if (nick.length() > Config->NickLen)
{
source.Reply(BOT_BAD_NICK);
source.Reply(_("Bot Nicks may only contain valid nick characters."));
return MOD_CONT;
}
if (user.length() > Config->UserLen)
{
source.Reply(BOT_LONG_IDENT, Config->UserLen);
source.Reply(_("Bot Idents may only contain %d characters."), Config->UserLen);
return MOD_CONT;
}
if (host.length() > Config->HostLen)
{
source.Reply(BOT_LONG_HOST, Config->HostLen);
source.Reply(_("Bot Hosts may only contain %d characters."), Config->HostLen);
return MOD_CONT;
}
/* Check the nick is valid re RFC 2812 */
if (isdigit(nick[0]) || nick[0] == '-')
{
source.Reply(BOT_BAD_NICK);
source.Reply(_("Bot Nicks may only contain valid nick characters."));
return MOD_CONT;
}
for (unsigned i = 0, end = nick.length(); i < end && i < Config->NickLen; ++i)
if (!isvalidnick(nick[i]))
{
source.Reply(BOT_BAD_NICK);
source.Reply(_("Bot Nicks may only contain valid nick characters."));
return MOD_CONT;
}
/* check for hardcored ircd forbidden nicks */
if (!ircdproto->IsNickValid(nick))
{
source.Reply(BOT_BAD_NICK);
source.Reply(_("Bot Nicks may only contain valid nick characters."));
return MOD_CONT;
}
/* Check the host is valid re RFC 2812 */
if (!isValidHost(host, 3))
{
source.Reply(BOT_BAD_HOST);
source.Reply(_("Bot Hosts may only contain valid host characters."));
return MOD_CONT;
}
for (unsigned i = 0, end = user.length(); i < end && i < Config->UserLen; ++i)
if (!isalnum(user[i]))
{
source.Reply(BOT_BAD_IDENT, Config->UserLen);
source.Reply(_("Bot Idents may only contain valid characters."), Config->UserLen);
return MOD_CONT;
}
@@ -89,20 +89,20 @@ class CommandBSBot : public Command
*/
if (findnick(nick))
{
source.Reply(NICK_ALREADY_REGISTERED, nick.c_str());
source.Reply(LanguageString::NICK_ALREADY_REGISTERED, nick.c_str());
return MOD_CONT;
}
if (!(bi = new BotInfo(nick, user, host, real)))
{
// XXX this cant happen?
source.Reply(BOT_BOT_CREATION_FAILED);
source.Reply(_("Sorry, bot creation failed."));
return MOD_CONT;
}
Log(LOG_ADMIN, source.u, this) << "ADD " << bi->GetMask() << " " << bi->realname;
source.Reply(BOT_BOT_ADDED, bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str());
source.Reply(_("%s!%s@%s (%s) added to the bot list."), bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str());
FOREACH_MOD(I_OnBotCreate, OnBotCreate(bi));
return MOD_CONT;
@@ -125,37 +125,37 @@ class CommandBSBot : public Command
if (!(bi = findbot(oldnick)))
{
source.Reply(BOT_DOES_NOT_EXIST, oldnick.c_str());
source.Reply(LanguageString::BOT_DOES_NOT_EXIST, oldnick.c_str());
return MOD_CONT;
}
if (!oldnick.equals_ci(nick) && nickIsServices(oldnick, false))
{
source.Reply(BOT_DOES_NOT_EXIST, oldnick.c_str());
source.Reply(LanguageString::BOT_DOES_NOT_EXIST, oldnick.c_str());
return MOD_CONT;
}
if (nick.length() > Config->NickLen)
{
source.Reply(BOT_BAD_NICK);
source.Reply(_("Bot Nicks may only contain valid nick characters."));
return MOD_CONT;
}
if (!user.empty() && user.length() > Config->UserLen)
{
source.Reply(BOT_LONG_IDENT, Config->UserLen);
source.Reply(_("Bot Idents may only contain %d characters."), Config->UserLen);
return MOD_CONT;
}
if (!host.empty() && host.length() > Config->HostLen)
{
source.Reply(BOT_LONG_HOST, Config->HostLen);
source.Reply(_("Bot Hosts may only contain %d characters."), Config->HostLen);
return MOD_CONT;
}
if (!oldnick.equals_ci(nick) && nickIsServices(nick, false))
{
source.Reply(BOT_DOES_NOT_EXIST, oldnick.c_str());
source.Reply(LanguageString::BOT_DOES_NOT_EXIST, oldnick.c_str());
return MOD_CONT;
}
@@ -166,34 +166,34 @@ class CommandBSBot : public Command
*/
if (nick.equals_cs(bi->nick) && (!user.empty() ? user.equals_cs(bi->GetIdent()) : 1) && (!host.empty() ? host.equals_cs(bi->host) : 1) && (!real.empty() ? real.equals_cs(bi->realname) : 1))
{
source.Reply(BOT_BOT_ANY_CHANGES);
source.Reply(_("Old info is equal to the new one."));
return MOD_CONT;
}
/* Check the nick is valid re RFC 2812 */
if (isdigit(nick[0]) || nick[0] == '-')
{
source.Reply(BOT_BAD_NICK);
source.Reply(_("Bot Nicks may only contain valid nick characters."));
return MOD_CONT;
}
for (unsigned i = 0, end = nick.length(); i < end && i < Config->NickLen; ++i)
if (!isvalidnick(nick[i]))
{
source.Reply(BOT_BAD_NICK);
source.Reply(_("Bot Nicks may only contain valid nick characters."));
return MOD_CONT;
}
/* check for hardcored ircd forbidden nicks */
if (!ircdproto->IsNickValid(nick))
{
source.Reply(BOT_BAD_NICK);
source.Reply(_("Bot Nicks may only contain valid nick characters."));
return MOD_CONT;
}
if (!host.empty() && !isValidHost(host, 3))
{
source.Reply(BOT_BAD_HOST);
source.Reply(_("Bot Hosts may only contain valid host characters."));
return MOD_CONT;
}
@@ -201,13 +201,13 @@ class CommandBSBot : public Command
for (unsigned i = 0, end = user.length(); i < end && i < Config->UserLen; ++i)
if (!isalnum(user[i]))
{
source.Reply(BOT_BAD_IDENT, Config->UserLen);
source.Reply(_("Bot Idents may only contain valid characters."), Config->UserLen);
return MOD_CONT;
}
if (!nick.equals_ci(bi->nick) && findbot(nick))
{
source.Reply(BOT_BOT_ALREADY_EXISTS, nick.c_str());
source.Reply(_("Bot \002%s\002 already exists."), nick.c_str());
return MOD_CONT;
}
@@ -219,7 +219,7 @@ class CommandBSBot : public Command
*/
if (findnick(nick))
{
source.Reply(NICK_ALREADY_REGISTERED, nick.c_str());
source.Reply(LanguageString::NICK_ALREADY_REGISTERED, nick.c_str());
return MOD_CONT;
}
@@ -262,7 +262,7 @@ class CommandBSBot : public Command
bi->RejoinAll();
}
source.Reply(BOT_BOT_CHANGED, oldnick.c_str(), bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str());
source.Reply(_("Bot \002%s\002 has been changed to %s!%s@%s (%s)"), oldnick.c_str(), bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str());
Log(LOG_ADMIN, source.u, this) << "CHANGE " << oldnick << " to " << bi->GetMask() << " " << bi->realname;
FOREACH_MOD(I_OnBotChange, OnBotChange(bi));
@@ -282,13 +282,13 @@ class CommandBSBot : public Command
if (!(bi = findbot(nick)))
{
source.Reply(BOT_DOES_NOT_EXIST, nick.c_str());
source.Reply(LanguageString::BOT_DOES_NOT_EXIST, nick.c_str());
return MOD_CONT;
}
if (nickIsServices(nick, false))
{
source.Reply(BOT_DOES_NOT_EXIST, nick.c_str());
source.Reply(LanguageString::BOT_DOES_NOT_EXIST, nick.c_str());
return MOD_CONT;
}
@@ -296,7 +296,7 @@ class CommandBSBot : public Command
Log(LOG_ADMIN, source.u, this) << "DEL " << bi->nick;
source.Reply(BOT_BOT_DELETED, nick.c_str());
source.Reply(_("Bot \002%s\002 has been deleted."), nick.c_str());
delete bi;
return MOD_CONT;
}
@@ -313,7 +313,7 @@ class CommandBSBot : public Command
if (readonly)
{
source.Reply(BOT_BOT_READONLY);
source.Reply(_("Sorry, bot modification is temporarily disabled."));
return MOD_CONT;
}
@@ -322,7 +322,7 @@ class CommandBSBot : public Command
// ADD nick user host real - 5
if (!u->Account()->HasCommand("botserv/bot/add"))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
@@ -345,7 +345,7 @@ class CommandBSBot : public Command
// but only oldn and newn are required
if (!u->Account()->HasCommand("botserv/bot/change"))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
@@ -362,7 +362,7 @@ class CommandBSBot : public Command
// DEL nick
if (!u->Account()->HasCommand("botserv/bot/del"))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
@@ -382,18 +382,38 @@ class CommandBSBot : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(BOT_SERVADMIN_HELP_BOT);
source.Reply(_("Syntax: \002BOT ADD \037nick\037 \037user\037 \037host\037 \037real\037\002\n"
" \002BOT CHANGE \037oldnick\037 \037newnick\037 [\037user\037 [\037host\037 [\037real\037]]]\002\n"
" \002BOT DEL \037nick\037\002\n"
" \n"
"Allows Services Operators to create, modify, and delete\n"
"bots that users will be able to use on their own\n"
"channels.\n"
" \n"
"\002BOT ADD\002 adds a bot with the given nickname, username,\n"
"hostname and realname. Since no integrity checks are done \n"
"for these settings, be really careful.\n"
"\002BOT CHANGE\002 allows to change nickname, username, hostname\n"
"or realname of a bot without actually delete it (and all\n"
"the data associated with it).\n"
"\002BOT DEL\002 removes the given bot from the bot list. \n"
" \n"
"\002Note\002: you cannot create a bot that has a nick that is\n"
"currently registered. If an unregistered user is currently\n"
"using the nick, they will be killed."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "BOT", BOT_BOT_SYNTAX);
SyntaxError(source, "BOT", _("BOT ADD \037nick\037 \037user\037 \037host\037 \037real\037\n"
"\002BOT CHANGE \037oldnick\037 \037newnick\037 [\037user\037 [\037host\037 [\037real\037]]]\002\n"
"\002BOT DEL \037nick\037\002"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(BOT_HELP_CMD_BOT);
source.Reply(_(" BOT Maintains network bot list"));
}
};
+9 -12
View File
@@ -25,12 +25,6 @@ class CommandBSBotList : public Command
User *u = source.u;
unsigned count = 0;
if (BotListByNick.empty())
{
source.Reply(BOT_BOTLIST_EMPTY);
return MOD_CONT;
}
for (patricia_tree<BotInfo *, ci::ci_char_traits>::iterator it(BotListByNick); it.next();)
{
BotInfo *bi = *it;
@@ -38,7 +32,7 @@ class CommandBSBotList : public Command
if (!bi->HasFlag(BI_PRIVATE))
{
if (!count)
source.Reply(BOT_BOTLIST_HEADER);
source.Reply(_("Bot list:"));
++count;
source.Reply(" %-15s (%s@%s)", bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str());
}
@@ -46,7 +40,7 @@ class CommandBSBotList : public Command
if (u->Account()->HasCommand("botserv/botlist") && count < BotListByNick.size())
{
source.Reply(BOT_BOTLIST_PRIVATE_HEADER);
source.Reply(_("Bots reserved to IRC operators:"));
for (patricia_tree<BotInfo *, ci::ci_char_traits>::iterator it(BotListByNick); it.next();)
{
@@ -61,22 +55,25 @@ class CommandBSBotList : public Command
}
if (!count)
source.Reply(BOT_BOTLIST_EMPTY);
source.Reply(_("There are no bots available at this time.\n"
"Ask a Services Operator to create one!"));
else
source.Reply(BOT_BOTLIST_FOOTER, count);
source.Reply(_("%d bots available."), count);
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(BOT_HELP_BOTLIST);
source.Reply(_("Syntax: \002BOTLIST\002\n"
" \n"
"Lists all available bots on this network."));
return true;
}
void OnServHelp(CommandSource &source)
{
source.Reply(BOT_HELP_CMD_BOTLIST);
source.Reply(_(" BOTLIST Lists available bots"));
}
};
+11 -2
View File
@@ -32,11 +32,20 @@ class CommandBSHelp : public Command
{
// Abuse syntax error to display general list help.
User *u = source.u;
source.Reply(BOT_HELP);
source.Reply(_("\002%S\002 allows you to have a bot on your own channel.\n"
"It has been created for users that can't host or\n"
"configure a bot, or for use on networks that don't\n"
"allow user bots. Available commands are listed \n"
"below; to use them, type \002%R%S \037command\037\002. For \n"
"more information on a specific command, type \002%R\n"
"%S HELP \037command\037\002."));
for (CommandMap::const_iterator it = BotServ->Commands.begin(), it_end = BotServ->Commands.end(); it != it_end; ++it)
if (!Config->HidePrivilegedCommands || it->second->permission.empty() || (u->Account() && u->Account()->HasCommand(it->second->permission)))
it->second->OnServHelp(source);
source.Reply(BOT_HELP_FOOTER, Config->BSMinUsers, Config->s_ChanServ.c_str(), Config->BSFantasyCharacter[0]);
source.Reply(_("Bot will join a channel whenever there is at least\n"
"\002%d\002 user(s) on it. Additionally, all %s commands\n"
"can be used if fantasy is enabled by prefixing the command\n"
"name with a %c."), Config->BSMinUsers, Config->s_ChanServ.c_str(), Config->BSFantasyCharacter[0]);
}
};
+60 -54
View File
@@ -57,12 +57,12 @@ class CommandBSInfo : public Command
ChannelInfo *ci;
if (bi)
{
source.Reply(BOT_INFO_BOT_HEADER, bi->nick.c_str());
source.Reply(BOT_INFO_BOT_MASK, bi->GetIdent().c_str(), bi->host.c_str());
source.Reply(BOT_INFO_BOT_REALNAME, bi->realname.c_str());
source.Reply(BOT_INFO_BOT_CREATED, do_strftime(bi->created).c_str());
source.Reply(BOT_INFO_BOT_OPTIONS, GetString(u, (bi->HasFlag(BI_PRIVATE) ? NICK_INFO_OPT_PRIVATE : NICK_INFO_OPT_NONE)).c_str());
source.Reply(BOT_INFO_BOT_USAGE, bi->chancount);
source.Reply(_("Information for bot \002%s\002:"), bi->nick.c_str());
source.Reply(_(" Mask : %s@%s"), bi->GetIdent().c_str(), bi->host.c_str());
source.Reply(_(" Real name : %s"), bi->realname.c_str());
source.Reply(_(" Created : %s"), do_strftime(bi->created).c_str());
source.Reply(_(" Options : %s"), bi->HasFlag(BI_PRIVATE) ? _("Private") : _("None"));
source.Reply(_(" Used on : %d channel(s)"), bi->chancount);
if (u->Account()->HasPriv("botserv/administration"))
this->send_bot_channels(source, bi);
@@ -71,167 +71,173 @@ class CommandBSInfo : public Command
{
if (!check_access(u, ci, CA_FOUNDER) && !u->Account()->HasPriv("botserv/administration"))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
source.Reply(CHAN_INFO_HEADER, ci->name.c_str());
source.Reply(LanguageString::CHAN_INFO_HEADER, ci->name.c_str());
if (ci->bi)
source.Reply(BOT_INFO_CHAN_BOT, ci->bi->nick.c_str());
source.Reply(_(" Bot nick : %s"), ci->bi->nick.c_str());
else
source.Reply(BOT_INFO_CHAN_BOT_NONE);
source.Reply(_(" Bot nick : not assigned yet."));
if (ci->botflags.HasFlag(BS_KICK_BADWORDS))
{
if (ci->ttb[TTB_BADWORDS])
source.Reply(BOT_INFO_CHAN_KICK_BADWORDS_BAN, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->ttb[TTB_BADWORDS]);
source.Reply(_(" Bad words kicker : %s (%d kick(s) to ban)"), GetString(u->Account(), LanguageString::ENABLED).c_str(), ci->ttb[TTB_BADWORDS]);
else
source.Reply(BOT_INFO_CHAN_KICK_BADWORDS, GetString(u, BOT_INFO_ACTIVE).c_str());
source.Reply(_(" Bad words kicker : %s"), GetString(u->Account(), LanguageString::ENABLED).c_str());
}
else
source.Reply(BOT_INFO_CHAN_KICK_BADWORDS, GetString(u, BOT_INFO_INACTIVE).c_str());
source.Reply(_(" Bad words kicker : %s"), GetString(u->Account(), LanguageString::DISABLED).c_str());
if (ci->botflags.HasFlag(BS_KICK_BOLDS))
{
if (ci->ttb[TTB_BOLDS])
source.Reply(BOT_INFO_CHAN_KICK_BOLDS_BAN, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->ttb[TTB_BOLDS]);
source.Reply(_(" Bolds kicker : %s (%d kick(s) to ban)"), GetString(u->Account(), LanguageString::ENABLED).c_str(), ci->ttb[TTB_BOLDS]);
else
source.Reply(BOT_INFO_CHAN_KICK_BOLDS, GetString(u, BOT_INFO_ACTIVE).c_str());
source.Reply(_(" Bolds kicker : %s"), GetString(u->Account(), LanguageString::ENABLED).c_str());
}
else
source.Reply(BOT_INFO_CHAN_KICK_BOLDS, GetString(u, BOT_INFO_INACTIVE).c_str());
source.Reply(_(" Bolds kicker : %s"), GetString(u->Account(), LanguageString::DISABLED).c_str());
if (ci->botflags.HasFlag(BS_KICK_CAPS))
{
if (ci->ttb[TTB_CAPS])
source.Reply(BOT_INFO_CHAN_KICK_CAPS_BAN, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->ttb[TTB_CAPS], ci->capsmin, ci->capspercent);
source.Reply(_(" Caps kicker : %s (%d kick(s) to ban; minimum %d/%d%%)"), GetString(u->Account(), LanguageString::ENABLED).c_str(), ci->ttb[TTB_CAPS], ci->capsmin, ci->capspercent);
else
source.Reply(BOT_INFO_CHAN_KICK_CAPS_ON, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->capsmin, ci->capspercent);
source.Reply(_(" Caps kicker : %s (minimum %d/%d%%)"), GetString(u->Account(), LanguageString::ENABLED).c_str(), ci->capsmin, ci->capspercent);
}
else
source.Reply(BOT_INFO_CHAN_KICK_CAPS_OFF, GetString(u, BOT_INFO_INACTIVE).c_str());
source.Reply(_(" Caps kicker : %s"), GetString(u->Account(), LanguageString::DISABLED).c_str());
if (ci->botflags.HasFlag(BS_KICK_COLORS))
{
if (ci->ttb[TTB_COLORS])
source.Reply(BOT_INFO_CHAN_KICK_COLORS_BAN, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->ttb[TTB_COLORS]);
source.Reply(_(" Colors kicker : %s (%d kick(s) to ban)"), GetString(u->Account(), LanguageString::ENABLED).c_str(), ci->ttb[TTB_COLORS]);
else
source.Reply(BOT_INFO_CHAN_KICK_COLORS, GetString(u, BOT_INFO_ACTIVE).c_str());
source.Reply(_(" Colors kicker : %s"), GetString(u->Account(), LanguageString::ENABLED).c_str());
}
else
source.Reply(BOT_INFO_CHAN_KICK_COLORS, GetString(u, BOT_INFO_INACTIVE).c_str());
source.Reply(_(" Colors kicker : %s"), GetString(u->Account(), LanguageString::DISABLED).c_str());
if (ci->botflags.HasFlag(BS_KICK_FLOOD))
{
if (ci->ttb[TTB_FLOOD])
source.Reply(BOT_INFO_CHAN_KICK_FLOOD_BAN, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->ttb[TTB_FLOOD], ci->floodlines, ci->floodsecs);
source.Reply(_(" Flood kicker : %s (%d kick(s) to ban; %d lines in %ds)"), GetString(u->Account(), LanguageString::ENABLED).c_str(), ci->ttb[TTB_FLOOD], ci->floodlines, ci->floodsecs);
else
source.Reply(BOT_INFO_CHAN_KICK_FLOOD_ON, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->floodlines, ci->floodsecs);
source.Reply(_(" Flood kicker : %s (%d lines in %ds)"), GetString(u->Account(), LanguageString::ENABLED).c_str(), ci->floodlines, ci->floodsecs);
}
else
source.Reply(BOT_INFO_CHAN_KICK_FLOOD_OFF, GetString(u, BOT_INFO_INACTIVE).c_str());
source.Reply(_(" Flood kicker : %s"), GetString(u->Account(), LanguageString::DISABLED).c_str());
if (ci->botflags.HasFlag(BS_KICK_REPEAT))
{
if (ci->ttb[TTB_REPEAT])
source.Reply(BOT_INFO_CHAN_KICK_REPEAT_BAN, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->ttb[TTB_REPEAT], ci->repeattimes);
source.Reply(_(" Repeat kicker : %s (%d kick(s) to ban; %d times)"), GetString(u->Account(), LanguageString::ENABLED).c_str(), ci->ttb[TTB_REPEAT], ci->repeattimes);
else
source.Reply(BOT_INFO_CHAN_KICK_REPEAT_ON, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->repeattimes);
source.Reply(_(" Repeat kicker : %s (%d times)"), GetString(u->Account(), LanguageString::ENABLED).c_str(), ci->repeattimes);
}
else
source.Reply(BOT_INFO_CHAN_KICK_REPEAT_OFF, GetString(u, BOT_INFO_INACTIVE).c_str());
source.Reply(_(" Repeat kicker : %s"), GetString(u->Account(), LanguageString::DISABLED).c_str());
if (ci->botflags.HasFlag(BS_KICK_REVERSES))
{
if (ci->ttb[TTB_REVERSES])
source.Reply(BOT_INFO_CHAN_KICK_REVERSES_BAN, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->ttb[TTB_REVERSES]);
source.Reply(_(" Reverses kicker : %s (%d kick(s) to ban)"), GetString(u->Account(), LanguageString::ENABLED).c_str(), ci->ttb[TTB_REVERSES]);
else
source.Reply(BOT_INFO_CHAN_KICK_REVERSES, GetString(u, BOT_INFO_ACTIVE).c_str());
source.Reply(_(" Reverses kicker : %s"), GetString(u->Account(), LanguageString::ENABLED).c_str());
}
else
source.Reply(BOT_INFO_CHAN_KICK_REVERSES, GetString(u, BOT_INFO_INACTIVE).c_str());
source.Reply(_(" Reverses kicker : %s"), GetString(u->Account(), LanguageString::DISABLED).c_str());
if (ci->botflags.HasFlag(BS_KICK_UNDERLINES))
{
if (ci->ttb[TTB_UNDERLINES])
source.Reply(BOT_INFO_CHAN_KICK_UNDERLINES_BAN, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->ttb[TTB_UNDERLINES]);
source.Reply(_(" Underlines kicker : %s (%d kick(s) to ban)"), GetString(u->Account(), LanguageString::ENABLED).c_str(), ci->ttb[TTB_UNDERLINES]);
else
source.Reply(BOT_INFO_CHAN_KICK_UNDERLINES, GetString(u, BOT_INFO_ACTIVE).c_str());
source.Reply(_(" Underlines kicker : %s"), GetString(u->Account(), LanguageString::ENABLED).c_str());
}
else
source.Reply(BOT_INFO_CHAN_KICK_UNDERLINES, GetString(u, BOT_INFO_INACTIVE).c_str());
source.Reply(_(" Underlines kicker : %s"), GetString(u->Account(), LanguageString::DISABLED).c_str());
if (ci->botflags.HasFlag(BS_KICK_ITALICS))
{
if (ci->ttb[TTB_ITALICS])
source.Reply(BOT_INFO_CHAN_KICK_ITALICS_BAN, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->ttb[TTB_ITALICS]);
source.Reply(_(" Italics kicker : %s (%d kick(s) to ban)"), GetString(u->Account(), LanguageString::ENABLED).c_str(), ci->ttb[TTB_ITALICS]);
else
source.Reply(BOT_INFO_CHAN_KICK_ITALICS, GetString(u, BOT_INFO_ACTIVE).c_str());
source.Reply(_(" Italics kicker : %s"), GetString(u->Account(), LanguageString::ENABLED).c_str());
}
else
source.Reply(BOT_INFO_CHAN_KICK_ITALICS, GetString(u, BOT_INFO_INACTIVE).c_str());
source.Reply(_(" Italics kicker : %s"), GetString(u->Account(), LanguageString::DISABLED).c_str());
if (ci->botflags.HasFlag(BS_KICK_AMSGS))
{
if (ci->ttb[TTB_AMSGS])
source.Reply(BOT_INFO_CHAN_KICK_AMSGS_BAN, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->ttb[TTB_AMSGS]);
source.Reply(_(" AMSG kicker : %s (%d kick(s) to ban)"), GetString(u->Account(), LanguageString::ENABLED).c_str(), ci->ttb[TTB_AMSGS]);
else
source.Reply(BOT_INFO_CHAN_KICK_AMSGS, GetString(u, BOT_INFO_ACTIVE).c_str());
source.Reply(_(" AMSG kicker : %s"), GetString(u->Account(), LanguageString::ENABLED).c_str());
}
else
source.Reply(BOT_INFO_CHAN_KICK_AMSGS, GetString(u, BOT_INFO_INACTIVE).c_str());
source.Reply(_(" AMSG kicker : %s"), GetString(u->Account(), LanguageString::DISABLED).c_str());
if (ci->botflags.HasFlag(BS_MSG_PRIVMSG))
source.Reply(BOT_INFO_CHAN_MSG, "PRIVMSG");
source.Reply(_(" Fantasy reply : %s"), "PRIVMSG");
else if (ci->botflags.HasFlag(BS_MSG_NOTICE))
source.Reply(BOT_INFO_CHAN_MSG, "NOTICE");
source.Reply(_(" Fantasy reply : %s"), "NOTICE");
else if (ci->botflags.HasFlag(BS_MSG_NOTICEOPS))
source.Reply(BOT_INFO_CHAN_MSG, "NOTICEOPS");
source.Reply(_(" Fantasy reply : %s"), "NOTICEOPS");
end = buf;
*end = 0;
if (ci->botflags.HasFlag(BS_DONTKICKOPS))
{
end += snprintf(end, sizeof(buf) - (end - buf), "%s", GetString(u, BOT_INFO_OPT_DONTKICKOPS).c_str());
end += snprintf(end, sizeof(buf) - (end - buf), "%s", GetString(u->Account(), _("Ops protection")).c_str());
need_comma = true;
}
if (ci->botflags.HasFlag(BS_DONTKICKVOICES))
{
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? ", " : "", GetString(u, BOT_INFO_OPT_DONTKICKVOICES).c_str());
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? ", " : "", GetString(u->Account(), _("Voices protection")).c_str());
need_comma = true;
}
if (ci->botflags.HasFlag(BS_FANTASY))
{
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? ", " : "", GetString(u, BOT_INFO_OPT_FANTASY).c_str());
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? ", " : "", GetString(u->Account(), _("Fantasy")).c_str());
need_comma = true;
}
if (ci->botflags.HasFlag(BS_GREET))
{
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? ", " : "", GetString(u, BOT_INFO_OPT_GREET).c_str());
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? ", " : "", GetString(u->Account(), _("Greet")).c_str());
need_comma = true;
}
if (ci->botflags.HasFlag(BS_NOBOT))
{
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? ", " : "", GetString(u, BOT_INFO_OPT_NOBOT).c_str());
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? ", " : "", GetString(u->Account(), _("No bot")).c_str());
need_comma = true;
}
if (ci->botflags.HasFlag(BS_SYMBIOSIS))
{
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? ", " : "", GetString(u, BOT_INFO_OPT_SYMBIOSIS).c_str());
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? ", " : "", GetString(u->Account(), _("Symbiosis")).c_str());
need_comma = true;
}
source.Reply(BOT_INFO_CHAN_OPTIONS, *buf ? buf : GetString(u, BOT_INFO_OPT_NONE).c_str());
source.Reply(_(" Options : %s"), *buf ? buf : GetString(u->Account(), _("None")).c_str());
}
else
source.Reply(BOT_INFO_NOT_FOUND, query.c_str());
source.Reply(_("\002%s\002 is not a valid bot or registered channel."), query.c_str());
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(BOT_HELP_INFO);
source.Reply(_("Syntax: \002INFO {\037chan\037 | \037nick\037}\002\n"
" \n"
"Allows you to see %S information about a channel or a bot.\n"
"If the parameter is a channel, then you'll get information\n"
"such as enabled kickers. If the parameter is a nick,\n"
"you'll get information about a bot, such as creation\n"
"time or number of channels it is on."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "INFO", BOT_INFO_SYNTAX);
SyntaxError(source, "INFO", _("INFO {\037chan\037 | \037nick\037}"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(BOT_HELP_CMD_INFO);
source.Reply(_(" INFO Allows you to see BotServ information about a channel or a bot"));
}
};
+153 -60
View File
@@ -32,15 +32,15 @@ class CommandBSKick : public Command
ChannelInfo *ci = source.ci;
if (readonly)
source.Reply(BOT_KICK_DISABLED);
source.Reply(_("Sorry, kicker configuration is temporarily disabled."));
else if (chan.empty() || option.empty() || value.empty())
SyntaxError(source, "KICK", BOT_KICK_SYNTAX);
SyntaxError(source, "KICK", _("KICK \037channel\037 \037option\037 {\037ON|\037} [\037settings\037]"));
else if (!value.equals_ci("ON") && !value.equals_ci("OFF"))
SyntaxError(source, "KICK", BOT_KICK_SYNTAX);
SyntaxError(source, "KICK", _("KICK \037channel\037 \037option\037 {\037ON|\037} [\037settings\037]"));
else if (!check_access(u, ci, CA_SET) && !u->Account()->HasPriv("botserv/administration"))
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
else if (!ci->bi)
source.Reply(BOT_NOT_ASSIGNED);
source.Reply(LanguageString::BOT_NOT_ASSIGNED);
else
{
bool override = !check_access(u, ci, CA_SET);
@@ -61,7 +61,7 @@ class CommandBSKick : public Command
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_BADWORDS];
/* reset the value back to 0 - TSL */
ci->ttb[TTB_BADWORDS] = 0;
source.Reply(BOT_KICK_BAD_TTB, ttb.c_str());
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
return MOD_CONT;
}
}
@@ -69,14 +69,17 @@ class CommandBSKick : public Command
ci->ttb[TTB_BADWORDS] = 0;
ci->botflags.SetFlag(BS_KICK_BADWORDS);
if (ci->ttb[TTB_BADWORDS])
source.Reply(BOT_KICK_BADWORDS_ON_BAN, ci->ttb[TTB_BADWORDS]);
source.Reply(_("Bot will now kick \002bad words\002, and will place a ban after \n"
"%d kicks for the same user. Use the BADWORDS command\n"
"to add or remove a bad word."), ci->ttb[TTB_BADWORDS]);
else
source.Reply(BOT_KICK_BADWORDS_ON);
source.Reply(_("Bot will now kick \002bad words\002. Use the BADWORDS command\n"
"to add or remove a bad word."));
}
else
{
ci->botflags.UnsetFlag(BS_KICK_BADWORDS);
source.Reply(BOT_KICK_BADWORDS_OFF);
source.Reply(_("Bot won't kick \002bad words\002 anymore."));
}
}
else if (option.equals_ci("BOLDS"))
@@ -91,7 +94,7 @@ class CommandBSKick : public Command
{
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_BOLDS];
ci->ttb[TTB_BOLDS] = 0;
source.Reply(BOT_KICK_BAD_TTB, ttb.c_str());
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
return MOD_CONT;
}
}
@@ -99,14 +102,14 @@ class CommandBSKick : public Command
ci->ttb[TTB_BOLDS] = 0;
ci->botflags.SetFlag(BS_KICK_BOLDS);
if (ci->ttb[TTB_BOLDS])
source.Reply(BOT_KICK_BOLDS_ON_BAN, ci->ttb[TTB_BOLDS]);
source.Reply(_("Bot will now kick \002bolds\002, and will place a ban after\n%d kicks to the same user."), ci->ttb[TTB_BOLDS]);
else
source.Reply(BOT_KICK_BOLDS_ON);
source.Reply(_("Bot will now kick \002bolds\002."));
}
else
{
ci->botflags.UnsetFlag(BS_KICK_BOLDS);
source.Reply(BOT_KICK_BOLDS_OFF);
source.Reply(_("Bot won't kick \002bolds\002 anymore."));
}
}
else if (option.equals_ci("CAPS"))
@@ -124,7 +127,7 @@ class CommandBSKick : public Command
{
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_CAPS];
ci->ttb[TTB_CAPS] = 0;
source.Reply(BOT_KICK_BAD_TTB, ttb.c_str());
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
return MOD_CONT;
}
}
@@ -147,14 +150,17 @@ class CommandBSKick : public Command
ci->botflags.SetFlag(BS_KICK_CAPS);
if (ci->ttb[TTB_CAPS])
source.Reply(BOT_KICK_CAPS_ON_BAN, ci->capsmin, ci->capspercent, ci->ttb[TTB_CAPS]);
source.Reply(_("Bot will now kick \002caps\002 (they must constitute at least\n"
"%d characters and %d%% of the entire message), and will \n"
"place a ban after %d kicks for the same user."), ci->capsmin, ci->capspercent, ci->ttb[TTB_CAPS]);
else
source.Reply(BOT_KICK_CAPS_ON, ci->capsmin, ci->capspercent);
source.Reply(_("Bot will now kick \002caps\002 (they must constitute at least\n"
"%d characters and %d%% of the entire message)."), ci->capsmin, ci->capspercent);
}
else
{
ci->botflags.UnsetFlag(BS_KICK_CAPS);
source.Reply(BOT_KICK_CAPS_OFF);
source.Reply(_("Bot won't kick \002caps\002 anymore."));
}
}
else if (option.equals_ci("COLORS"))
@@ -169,7 +175,7 @@ class CommandBSKick : public Command
{
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_COLORS];
ci->ttb[TTB_COLORS] = 0;
source.Reply(BOT_KICK_BAD_TTB, ttb.c_str());
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
return MOD_CONT;
}
}
@@ -177,14 +183,14 @@ class CommandBSKick : public Command
ci->ttb[TTB_COLORS] = 0;
ci->botflags.SetFlag(BS_KICK_COLORS);
if (ci->ttb[TTB_COLORS])
source.Reply(BOT_KICK_COLORS_ON_BAN, ci->ttb[TTB_COLORS]);
source.Reply(_("Bot will now kick \002colors\002, and will place a ban after %d\nkicks for the same user."), ci->ttb[TTB_COLORS]);
else
source.Reply(BOT_KICK_COLORS_ON);
source.Reply(_("Bot will now kick \002colors\002."));
}
else
{
ci->botflags.UnsetFlag(BS_KICK_COLORS);
source.Reply(BOT_KICK_COLORS_OFF);
source.Reply(_("Bot won't kick \002colors\002 anymore."));
}
}
else if (option.equals_ci("FLOOD"))
@@ -202,7 +208,7 @@ class CommandBSKick : public Command
{
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_FLOOD];
ci->ttb[TTB_FLOOD] = 0;
source.Reply(BOT_KICK_BAD_TTB, ttb.c_str());
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
return MOD_CONT;
}
}
@@ -225,14 +231,14 @@ class CommandBSKick : public Command
ci->botflags.SetFlag(BS_KICK_FLOOD);
if (ci->ttb[TTB_FLOOD])
source.Reply(BOT_KICK_FLOOD_ON_BAN, ci->floodlines, ci->floodsecs, ci->ttb[TTB_FLOOD]);
source.Reply(_("Bot will now kick \002flood\002 (%d lines in %d seconds and\nwill place a ban after %d kicks for the same user."), ci->floodlines, ci->floodsecs, ci->ttb[TTB_FLOOD]);
else
source.Reply(BOT_KICK_FLOOD_ON, ci->floodlines, ci->floodsecs);
source.Reply(_("Bot will now kick \002flood\002 (%d lines in %d seconds)."), ci->floodlines, ci->floodsecs);
}
else
{
ci->botflags.UnsetFlag(BS_KICK_FLOOD);
source.Reply(BOT_KICK_FLOOD_OFF);
source.Reply(_("Bot won't kick \002flood\002 anymore."));
}
}
else if (option.equals_ci("REPEAT"))
@@ -249,7 +255,7 @@ class CommandBSKick : public Command
{
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_REPEAT];
ci->ttb[TTB_REPEAT] = 0;
source.Reply(BOT_KICK_BAD_TTB, ttb.c_str());
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
return MOD_CONT;
}
}
@@ -265,14 +271,17 @@ class CommandBSKick : public Command
ci->botflags.SetFlag(BS_KICK_REPEAT);
if (ci->ttb[TTB_REPEAT])
source.Reply(BOT_KICK_REPEAT_ON_BAN, ci->repeattimes, ci->ttb[TTB_REPEAT]);
source.Reply(_("Bot will now kick \002repeats\002 (users that say %d times\n"
"the same thing), and will place a ban after %d \n"
"kicks for the same user."), ci->repeattimes, ci->ttb[TTB_REPEAT]);
else
source.Reply(BOT_KICK_REPEAT_ON, ci->repeattimes);
source.Reply(_("Bot will now kick \002repeats\002 (users that say %d times\n"
"the same thing)."), ci->repeattimes);
}
else
{
ci->botflags.UnsetFlag(BS_KICK_REPEAT);
source.Reply(BOT_KICK_REPEAT_OFF);
source.Reply(_("Bot won't kick \002repeats\002 anymore."));
}
}
else if (option.equals_ci("REVERSES"))
@@ -287,7 +296,7 @@ class CommandBSKick : public Command
{
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_REVERSES];
ci->ttb[TTB_REVERSES] = 0;
source.Reply(BOT_KICK_BAD_TTB, ttb.c_str());
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
return MOD_CONT;
}
}
@@ -295,14 +304,14 @@ class CommandBSKick : public Command
ci->ttb[TTB_REVERSES] = 0;
ci->botflags.SetFlag(BS_KICK_REVERSES);
if (ci->ttb[TTB_REVERSES])
source.Reply(BOT_KICK_REVERSES_ON_BAN, ci->ttb[TTB_REVERSES]);
source.Reply(_("Bot will now kick \002reverses\002, and will place a ban after %d\nkicks for the same user."), ci->ttb[TTB_REVERSES]);
else
source.Reply(BOT_KICK_REVERSES_ON);
source.Reply(_("Bot will now kick \002reverses\002."));
}
else
{
ci->botflags.UnsetFlag(BS_KICK_REVERSES);
source.Reply(BOT_KICK_REVERSES_OFF);
source.Reply(_("Bot won't kick \002reverses\002 anymore."));
}
}
else if (option.equals_ci("UNDERLINES"))
@@ -317,7 +326,7 @@ class CommandBSKick : public Command
{
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_UNDERLINES];
ci->ttb[TTB_UNDERLINES] = 0;
source.Reply(BOT_KICK_BAD_TTB, ttb.c_str());
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
return MOD_CONT;
}
}
@@ -325,14 +334,14 @@ class CommandBSKick : public Command
ci->ttb[TTB_UNDERLINES] = 0;
ci->botflags.SetFlag(BS_KICK_UNDERLINES);
if (ci->ttb[TTB_UNDERLINES])
source.Reply(BOT_KICK_UNDERLINES_ON_BAN, ci->ttb[TTB_UNDERLINES]);
source.Reply(_("Bot will now kick \002underlines\002, and will place a ban after %d\nkicks for the same user."), ci->ttb[TTB_UNDERLINES]);
else
source.Reply(BOT_KICK_UNDERLINES_ON);
source.Reply(_("Bot will now kick \002underlines\002."));
}
else
{
ci->botflags.UnsetFlag(BS_KICK_UNDERLINES);
source.Reply(BOT_KICK_UNDERLINES_OFF);
source.Reply(_("Bot won't kick \002underlines\002 anymore."));
}
}
else if (option.equals_ci("ITALICS"))
@@ -347,7 +356,7 @@ class CommandBSKick : public Command
{
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_ITALICS];
ci->ttb[TTB_ITALICS] = 0;
source.Reply(BOT_KICK_BAD_TTB, ttb.c_str());
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
return MOD_CONT;
}
}
@@ -355,14 +364,14 @@ class CommandBSKick : public Command
ci->ttb[TTB_ITALICS] = 0;
ci->botflags.SetFlag(BS_KICK_ITALICS);
if (ci->ttb[TTB_ITALICS])
source.Reply(BOT_KICK_ITALICS_ON_BAN, ci->ttb[TTB_ITALICS]);
source.Reply(_("Bot will now kick \002italics\002, and will place a ban after\n%d kicks for the same user."), ci->ttb[TTB_ITALICS]);
else
source.Reply(BOT_KICK_ITALICS_ON);
source.Reply(_("Bot will now kick \002italics\002."));
}
else
{
ci->botflags.UnsetFlag(BS_KICK_ITALICS);
source.Reply(BOT_KICK_ITALICS_OFF);
source.Reply(_("Bot won't kick \002italics\002 anymore."));
}
}
else if (option.equals_ci("AMSGS"))
@@ -377,7 +386,6 @@ class CommandBSKick : public Command
{
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_ITALICS];
ci->ttb[TTB_AMSGS] = 0;
source.Reply(BOT_KICK_AMSGS_ON_BAN, ci->ttb[TTB_AMSGS]);
return MOD_CONT;
}
}
@@ -385,18 +393,18 @@ class CommandBSKick : public Command
ci->ttb[TTB_AMSGS] = 0;
ci->botflags.SetFlag(BS_KICK_AMSGS);
if (ci->ttb[TTB_AMSGS])
source.Reply(BOT_KICK_AMSGS_ON_BAN, ci->ttb[TTB_AMSGS]);
source.Reply(_("Bot will now kick for \002amsgs\002, and will place a ban after %d\nkicks for the same user."), ci->ttb[TTB_AMSGS]);
else
source.Reply(BOT_KICK_AMSGS_ON);
source.Reply(_("Bot will now kick for \002amsgs\002"));
}
else
{
ci->botflags.UnsetFlag(BS_KICK_AMSGS);
source.Reply(BOT_KICK_AMSGS_OFF);
source.Reply(_("Bot won't kick for \002amsgs\002 anymore."));
}
}
else
source.Reply(BOT_KICK_UNKNOWN, option.c_str());
source.Reply(LanguageString::UNKNOWN_OPTION, option.c_str(), this->name.c_str());
}
return MOD_CONT;
}
@@ -404,27 +412,112 @@ class CommandBSKick : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
if (subcommand.empty())
source.Reply(BOT_HELP_KICK);
source.Reply(_("Syntax: \002KICK \037channel\037 \037option\037 \037parameters\037\002\n"
" \n"
"Configures bot kickers. \037option\037 can be one of:\n"
" \n"
" AMSGS Sets if the bot kicks for amsgs\n"
" BOLDS Sets if the bot kicks bolds\n"
" BADWORDS Sets if the bot kicks bad words\n"
" CAPS Sets if the bot kicks caps\n"
" COLORS Sets if the bot kicks colors\n"
" FLOOD Sets if the bot kicks flooding users\n"
" REPEAT Sets if the bot kicks users who repeat\n"
" themselves\n"
" REVERSES Sets if the bot kicks reverses\n"
" UNDERLINES Sets if the bot kicks underlines\n"
" ITALICS Sets if the bot kicks italics\n"
" \n"
"Type \002%R%S HELP KICK \037option\037\002 for more information\n"
"on a specific option.\n"
" \n"
"Note: access to this command is controlled by the\n"
"level SET."));
else if (subcommand.equals_ci("BADWORDS"))
source.Reply(BOT_HELP_KICK_BADWORDS);
source.Reply(_("Syntax: \002KICK \037#channel\037 BADWORDS {\037ON|OFF\037} [\037ttb\037]\002\n"
"Sets the bad words kicker on or off. When enabled, this\n"
"option tells the bot to kick users who say certain words\n"
"on the channels.\n"
"You can define bad words for your channel using the\n"
"\002BADWORDS\002 command. Type \002%R%S HELP BADWORDS\002 for\n"
"more information.\n"
"ttb is the number of times a user can be kicked\n"
"before it get banned. Don't give ttb to disable\n"
"the ban system once activated."));
else if (subcommand.equals_ci("BOLDS"))
source.Reply(BOT_HELP_KICK_BOLDS);
source.Reply(_("Syntax: \002KICK \037channel\037 BOLDS {\037ON|OFF\037} [\037ttb\037]\002\n"
"Sets the bolds kicker on or off. When enabled, this\n"
"option tells the bot to kick users who use bolds.\n"
"ttb is the number of times a user can be kicked\n"
"before it get banned. Don't give ttb to disable\n"
"the ban system once activated."));
else if (subcommand.equals_ci("CAPS"))
source.Reply(BOT_HELP_KICK_CAPS);
source.Reply(_("Syntax: \002KICK \037channel\037 CAPS {\037ON|OFF\037} [\037ttb\037 [\037min\037 [\037percent\037]]]\002\n"
"Sets the caps kicker on or off. When enabled, this\n"
"option tells the bot to kick users who are talking in\n"
"CAPS.\n"
"The bot kicks only if there are at least \002min\002 caps\n"
"and they constitute at least \002percent\002%% of the total \n"
"text line (if not given, it defaults to 10 characters\n"
"and 25%%).\n"
"ttb is the number of times a user can be kicked\n"
"before it get banned. Don't give ttb to disable\n"
"the ban system once activated."));
else if (subcommand.equals_ci("COLORS"))
source.Reply(BOT_HELP_KICK_COLORS);
source.Reply(_("Syntax: \002KICK \037channel\037 COLORS {\037ON|OFF\037} [\037ttb\037]\002\n"
"Sets the colors kicker on or off. When enabled, this\n"
"option tells the bot to kick users who use colors.\n"
"ttb is the number of times a user can be kicked\n"
"before it get banned. Don't give ttb to disable\n"
"the ban system once activated."));
else if (subcommand.equals_ci("FLOOD"))
source.Reply(BOT_HELP_KICK_FLOOD);
source.Reply(_("Syntax: \002KICK \037channel\037 FLOOD {\037ON|OFF\037} [\037ttb\037 [\037ln\037 [\037secs\037]]]\002\n"
"Sets the flood kicker on or off. When enabled, this\n"
"option tells the bot to kick users who are flooding\n"
"the channel using at least \002ln\002 lines in \002secs\002 seconds\n"
"(if not given, it defaults to 6 lines in 10 seconds).\n"
" \n"
"ttb is the number of times a user can be kicked\n"
"before it get banned. Don't give ttb to disable\n"
"the ban system once activated."));
else if (subcommand.equals_ci("REPEAT"))
source.Reply(BOT_HELP_KICK_REPEAT);
source.Reply(_("Syntax: \002KICK \037#channel\037 REPEAT {\037ON|OFF\037} [\037ttb\037 [\037num\037]]\002\n"
"Sets the repeat kicker on or off. When enabled, this\n"
"option tells the bot to kick users who are repeating\n"
"themselves \002num\002 times (if num is not given, it\n"
"defaults to 3).\n"
"ttb is the number of times a user can be kicked\n"
"before it get banned. Don't give ttb to disable\n"
"the ban system once activated."));
else if (subcommand.equals_ci("REVERSES"))
source.Reply(BOT_HELP_KICK_REVERSES);
source.Reply(_("Syntax: \002KICK \037channel\037 REVERSES {\037ON|OFF\037} [\037ttb\037]\002\n"
"Sets the reverses kicker on or off. When enabled, this\n"
"option tells the bot to kick users who use reverses.\n"
"ttb is the number of times a user can be kicked\n"
"before it get banned. Don't give ttb to disable\n"
"the ban system once activated."));
else if (subcommand.equals_ci("UNDERLINES"))
source.Reply(BOT_HELP_KICK_UNDERLINES);
source.Reply(_("Syntax: \002KICK \037channel\037 UNDERLINES {\037ON|OFF\037} [\037ttb\037]\002\n"
"Sets the underlines kicker on or off. When enabled, this\n"
"option tells the bot to kick users who use underlines.\n"
"ttb is the number of times a user can be kicked\n"
"before it get banned. Don't give ttb to disable\n"
"the ban system once activated."));
else if (subcommand.equals_ci("ITALICS"))
source.Reply(BOT_HELP_KICK_ITALICS);
source.Reply(_("Syntax: \002KICK \037channel\037 ITALICS {\037ON|OFF\037} [\037ttb\037]\002\n"
"Sets the italics kicker on or off. When enabled, this\n"
"option tells the bot to kick users who use italics.\n"
"ttb is the number of times a user can be kicked\n"
"before it get banned. Don't give ttb to disable\n"
"the ban system once activated."));
else if (subcommand.equals_ci("AMSGS"))
source.Reply(BOT_HELP_KICK_AMSGS);
source.Reply(_("Syntax: \002KICK \037channel\037 AMSGS {\037ON|OFF\037} [\037ttb\037]\002\n"
"Sets the amsg kicker on or off. When enabled, the bot will\n"
"kick users who send the same message to multiple channels\n"
"where BotServ bots are.\n"
"Ttb is the number of times a user can be kicked\n"
"before it get banned. Don't give ttb to disable\n"
"the ban system once activated."));
else
return false;
@@ -433,12 +526,12 @@ class CommandBSKick : public Command
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "KICK", BOT_KICK_SYNTAX);
SyntaxError(source, "KICK", _("KICK \037channel\037 \037option\037 {\037ON|\037} [\037settings\037]"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(BOT_HELP_CMD_KICK);
source.Reply(_(" KICK Configures kickers"));
}
};
@@ -474,7 +567,7 @@ class BSKick : public Module
if (c->ci != NULL && c->ci->botflags.HasFlag(BS_KICK_AMSGS))
{
check_ban(c->ci, u, TTB_AMSGS);
bot_kick(c->ci, u, BOT_REASON_AMSGS);
bot_kick(c->ci, u, _("Don't use AMSGs!"));
}
}
+8 -6
View File
@@ -29,19 +29,19 @@ class CommandBSSay : public Command
if (!check_access(u, ci, CA_SAY))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
if (!ci->bi)
{
source.Reply(BOT_NOT_ASSIGNED);
source.Reply(LanguageString::BOT_NOT_ASSIGNED);
return MOD_CONT;
}
if (!ci->c || !ci->c->FindUser(ci->bi))
{
source.Reply(BOT_NOT_ON_CHANNEL, ci->name.c_str());
source.Reply(LanguageString::BOT_NOT_ON_CHANNEL, ci->name.c_str());
return MOD_CONT;
}
@@ -62,18 +62,20 @@ class CommandBSSay : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(BOT_HELP_SAY);
source.Reply(_("Syntax: \002SAY \037channel\037 \037text\037\002\n"
" \n"
"Makes the bot say the given text on the given channel."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "SAY", BOT_SAY_SYNTAX);
SyntaxError(source, "SAY", _("SAY \037channel\037 \037text\037"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(BOT_HELP_CMD_SAY);
source.Reply(_(" SAY Makes the bot say the given text on the given channel"));
}
};
+106 -43
View File
@@ -31,35 +31,35 @@ class CommandBSSet : public Command
ChannelInfo *ci;
if (readonly)
source.Reply(BOT_SET_DISABLED);
source.Reply(_("Sorry, bot option setting is temporarily disabled."));
else if (u->Account()->HasCommand("botserv/set/private") && option.equals_ci("PRIVATE"))
{
BotInfo *bi;
if (!(bi = findbot(chan)))
{
source.Reply(BOT_DOES_NOT_EXIST, chan.c_str());
source.Reply(LanguageString::BOT_DOES_NOT_EXIST, chan.c_str());
return MOD_CONT;
}
if (value.equals_ci("ON"))
{
bi->SetFlag(BI_PRIVATE);
source.Reply(BOT_SET_PRIVATE_ON, bi->nick.c_str());
source.Reply(_("Private mode of bot %s is now \002\002."), bi->nick.c_str());
}
else if (value.equals_ci("OFF"))
{
bi->UnsetFlag(BI_PRIVATE);
source.Reply(BOT_SET_PRIVATE_OFF, bi->nick.c_str());
source.Reply(_("Private mode of bot %s is now \002\002."), bi->nick.c_str());
}
else
SyntaxError(source, "SET PRIVATE", BOT_SET_PRIVATE_SYNTAX);
SyntaxError(source, "SET PRIVATE", _("SET \037botname\037 PRIVATE {\037ON|\037}"));
return MOD_CONT;
}
else if (!(ci = cs_findchan(chan)))
source.Reply(CHAN_X_NOT_REGISTERED, chan.c_str());
source.Reply(LanguageString::CHAN_X_NOT_REGISTERED, chan.c_str());
else if (!u->Account()->HasPriv("botserv/administration") && !check_access(u, ci, CA_SET))
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
else
{
bool override = !check_access(u, ci, CA_SET);
@@ -70,60 +70,60 @@ class CommandBSSet : public Command
if (value.equals_ci("ON"))
{
ci->botflags.SetFlag(BS_DONTKICKOPS);
source.Reply(BOT_SET_DONTKICKOPS_ON, ci->name.c_str());
source.Reply(_("Bot \002won't kick ops\002 on channel %s."), ci->name.c_str());
}
else if (value.equals_ci("OFF"))
{
ci->botflags.UnsetFlag(BS_DONTKICKOPS);
source.Reply(BOT_SET_DONTKICKOPS_OFF, ci->name.c_str());
source.Reply(_("Bot \002will kick ops\002 on channel %s."), ci->name.c_str());
}
else
SyntaxError(source, "SET DONTKICKOPS", BOT_SET_DONTKICKOPS_SYNTAX);
SyntaxError(source, "SET DONTKICKOPS", _("SET \037channel\037 DONTKICKOPS {\037ON|\037}"));
}
else if (option.equals_ci("DONTKICKVOICES"))
{
if (value.equals_ci("ON"))
{
ci->botflags.SetFlag(BS_DONTKICKVOICES);
source.Reply(BOT_SET_DONTKICKVOICES_ON, ci->name.c_str());
source.Reply(_("Bot \002won't kick voices\002 on channel %s."), ci->name.c_str());
}
else if (value.equals_ci("OFF"))
{
ci->botflags.UnsetFlag(BS_DONTKICKVOICES);
source.Reply(BOT_SET_DONTKICKVOICES_OFF, ci->name.c_str());
source.Reply(_("Bot \002will kick voices\002 on channel %s."), ci->name.c_str());
}
else
SyntaxError(source, "SET DONTKICKVOICES", BOT_SET_DONTKICKVOICES_SYNTAX);
SyntaxError(source, "SET DONTKICKVOICES", _("SET \037channel\037 DONTKICKVOICES {\037ON|\037}"));
}
else if (option.equals_ci("FANTASY"))
{
if (value.equals_ci("ON"))
{
ci->botflags.SetFlag(BS_FANTASY);
source.Reply(BOT_SET_FANTASY_ON, ci->name.c_str());
source.Reply(_("Fantasy mode is now \002\002 on channel %s."), ci->name.c_str());
}
else if (value.equals_ci("OFF"))
{
ci->botflags.UnsetFlag(BS_FANTASY);
source.Reply(BOT_SET_FANTASY_OFF, ci->name.c_str());
source.Reply(_("Fantasy mode is now \002\002 on channel %s."), ci->name.c_str());
}
else
SyntaxError(source, "SET FANTASY", BOT_SET_FANTASY_SYNTAX);
SyntaxError(source, "SET FANTASY", _("SET \037channel\037 FANTASY {\037ON|\037}"));
}
else if (option.equals_ci("GREET"))
{
if (value.equals_ci("ON"))
{
ci->botflags.SetFlag(BS_GREET);
source.Reply(BOT_SET_GREET_ON, ci->name.c_str());
source.Reply(_("Greet mode is now \002\002 on channel %s."), ci->name.c_str());
}
else if (value.equals_ci("OFF"))
{
ci->botflags.UnsetFlag(BS_GREET);
source.Reply(BOT_SET_GREET_OFF, ci->name.c_str());
source.Reply(_("Greet mode is now \002\002 on channel %s."), ci->name.c_str());
}
else
SyntaxError(source, "SET GREET", BOT_SET_GREET_SYNTAX);
SyntaxError(source, "SET GREET", _("SET \037channel\037 GREET {\037ON|\037}"));
}
else if (u->Account()->HasCommand("botserv/set/nobot") && option.equals_ci("NOBOT"))
{
@@ -132,30 +132,30 @@ class CommandBSSet : public Command
ci->botflags.SetFlag(BS_NOBOT);
if (ci->bi)
ci->bi->UnAssign(u, ci);
source.Reply(BOT_SET_NOBOT_ON, ci->name.c_str());
source.Reply(_("No Bot mode is now \002\002 on channel %s."), ci->name.c_str());
}
else if (value.equals_ci("OFF"))
{
ci->botflags.UnsetFlag(BS_NOBOT);
source.Reply(BOT_SET_NOBOT_OFF, ci->name.c_str());
source.Reply(_("No Bot mode is now \002\002 on channel %s."), ci->name.c_str());
}
else
SyntaxError(source, "SET NOBOT", BOT_SET_NOBOT_SYNTAX);
SyntaxError(source, "SET NOBOT", _("SET \037botname\037 NOBOT {\037ON|\037}"));
}
else if (option.equals_ci("SYMBIOSIS"))
{
if (value.equals_ci("ON"))
{
ci->botflags.SetFlag(BS_SYMBIOSIS);
source.Reply(BOT_SET_SYMBIOSIS_ON, ci->name.c_str());
source.Reply(_("Symbiosis mode is now \002\002 on channel %s."), ci->name.c_str());
}
else if (value.equals_ci("OFF"))
{
ci->botflags.UnsetFlag(BS_SYMBIOSIS);
source.Reply(BOT_SET_SYMBIOSIS_OFF, ci->name.c_str());
source.Reply(_("Symbiosis mode is now \002\002 on channel %s."), ci->name.c_str());
}
else
SyntaxError(source, "SET SYMBIOSIS", BOT_SET_SYMBIOSIS_SYNTAX);
SyntaxError(source, "SET SYMBIOSIS", _("SET \037channel\037 SYMBIOSIS {\037ON|\037}"));
}
else if (option.equals_ci("MSG"))
{
@@ -164,34 +164,34 @@ class CommandBSSet : public Command
ci->botflags.UnsetFlag(BS_MSG_PRIVMSG);
ci->botflags.UnsetFlag(BS_MSG_NOTICE);
ci->botflags.UnsetFlag(BS_MSG_NOTICEOPS);
source.Reply(BOT_SET_MSG_OFF, ci->name.c_str());
source.Reply(_("Fantasy replies will no longer be sent to %s."), ci->name.c_str());
}
else if (value.equals_ci("PRIVMSG"))
{
ci->botflags.SetFlag(BS_MSG_PRIVMSG);
ci->botflags.UnsetFlag(BS_MSG_NOTICE);
ci->botflags.UnsetFlag(BS_MSG_NOTICEOPS);
source.Reply(BOT_SET_MSG_PRIVMSG, ci->name.c_str());
source.Reply(_("Fantasy replies will be sent via PRIVMSG to %s."), ci->name.c_str());
}
else if (value.equals_ci("NOTICE"))
{
ci->botflags.UnsetFlag(BS_MSG_PRIVMSG);
ci->botflags.SetFlag(BS_MSG_NOTICE);
ci->botflags.UnsetFlag(BS_MSG_NOTICEOPS);
source.Reply(BOT_SET_MSG_NOTICE, ci->name.c_str());
source.Reply(_("Fantasy replies will be sent via NOTICE to %s."), ci->name.c_str());
}
else if (value.equals_ci("NOTICEOPS"))
{
ci->botflags.UnsetFlag(BS_MSG_PRIVMSG);
ci->botflags.UnsetFlag(BS_MSG_NOTICE);
ci->botflags.SetFlag(BS_MSG_NOTICEOPS);
source.Reply(BOT_SET_MSG_NOTICEOPS, ci->name.c_str());
source.Reply(_("Fantasy replies will be sent via NOTICE to channel ops on %s."), ci->name.c_str());
}
else
SyntaxError(source, "SET MSG", BOT_SET_MSG_SYNTAX);
SyntaxError(source, "SET MSG", _("SET \037channel\037 MSG {\037OFF|PRIVMSG|NOTICE|\037}"));
}
else
source.Reply(BOT_SET_UNKNOWN, option.c_str());
source.Reply(LanguageString::UNKNOWN_OPTION, option.c_str(), this->name.c_str());
}
return MOD_CONT;
@@ -201,27 +201,90 @@ class CommandBSSet : public Command
{
if (subcommand.empty())
{
source.Reply(BOT_HELP_SET);
source.Reply(_("Syntax: \002SET \037(channel | bot)\037 \037option\037 \037parameters\037\002\n"
" \n"
"Configures bot options. \037option\037 can be one of:\n"
" \n"
" DONTKICKOPS To protect ops against bot kicks\n"
" DONTKICKVOICES To protect voices against bot kicks\n"
" GREET Enable greet messages\n"
" FANTASY Enable fantaisist commands\n"
" SYMBIOSIS Allow the bot to act as a real bot\n"
" MSG Configure how fantasy commands should be replied to\n"
" \n"
"Type \002%R%S HELP SET \037option\037\002 for more information\n"
"on a specific option.\n"
"Note: access to this command is controlled by the\n"
"level SET."));
User *u = source.u;
if (u->Account() && u->Account()->IsServicesOper())
source.Reply(BOT_SERVADMIN_HELP_SET);
source.Reply(_("These options are reserved to Services Operators:\n"
" \n"
" NOBOT Prevent a bot from being assigned to \n"
" a channel\n"
" PRIVATE Prevent a bot from being assigned by\n"
" non IRC operators"));
}
else if (subcommand.equals_ci("DONTKICKOPS"))
source.Reply(BOT_HELP_SET_DONTKICKOPS);
source.Reply(_("Syntax: \002SET \037channel\037 DONTKICKOPS {\037ON|OFF\037}\n"
" \n"
"Enables or disables \002ops protection\002 mode on a channel.\n"
"When it is enabled, ops won't be kicked by the bot\n"
"even if they don't match the NOKICK level."));
else if (subcommand.equals_ci("DONTKICKVOICES"))
source.Reply(BOT_HELP_SET_DONTKICKVOICES);
source.Reply(_("Syntax: \002SET \037channel\037 DONTKICKVOICES {\037ON|OFF\037}\n"
" \n"
"Enables or disables \002voices protection\002 mode on a channel.\n"
"When it is enabled, voices won't be kicked by the bot\n"
"even if they don't match the NOKICK level."));
else if (subcommand.equals_ci("FANTASY"))
source.Reply(BOT_HELP_SET_FANTASY);
source.Reply(_("Syntax: \002SET \037channel\037 FANTASY {\037ON|OFF\037}\n"
"Enables or disables \002fantasy\002 mode on a channel.\n"
"When it is enabled, users will be able to use\n"
"commands !op, !deop, !voice, !devoice,\n"
"!kick, !kb, !unban, !seen on a channel (find how \n"
"to use them; try with or without nick for each, \n"
"and with a reason for some?).\n"
" \n"
"Note that users wanting to use fantaisist\n"
"commands MUST have enough level for both\n"
"the FANTASIA and another level depending\n"
"of the command if required (for example, to use \n"
"!op, user must have enough access for the OPDEOP\n"
"level)."));
else if (subcommand.equals_ci("GREET"))
source.Reply(BOT_HELP_SET_GREET);
source.Reply(_("Syntax: \002SET \037channel\037 GREET {\037ON|OFF\037}\n"
" \n"
"Enables or disables \002greet\002 mode on a channel.\n"
"When it is enabled, the bot will display greet\n"
"messages of users joining the channel, provided\n"
"they have enough access to the channel."));
else if (subcommand.equals_ci("SYMBIOSIS"))
source.Reply(BOT_HELP_SET_SYMBIOSIS, Config->s_ChanServ.c_str());
source.Reply(_("Syntax: \002SET \037channel\037 SYMBIOSIS {\037ON|OFF\037}\n"
" \n"
"Enables or disables \002symbiosis\002 mode on a channel.\n"
"When it is enabled, the bot will do everything\n"
"normally done by %s on channels, such as MODEs,\n"
"KICKs, and even the entry message."), Config->s_ChanServ.c_str());
else if (subcommand.equals_ci("NOBOT"))
source.Reply(BOT_SERVADMIN_HELP_SET_NOBOT);
source.Reply(_("Syntax: \002SET \037channel\037 NOBOT {\037ON|OFF\037}\002\n"
" \n"
"This option makes a channel be unassignable. If a bot \n"
"is already assigned to the channel, it is unassigned\n"
"automatically when you enable the option."));
else if (subcommand.equals_ci("PRIVATE"))
source.Reply(BOT_SERVADMIN_HELP_SET_PRIVATE);
source.Reply(_("Syntax: \002SET \037bot-nick\037 PRIVATE {\037ON|OFF\037}\002\n"
"This option prevents a bot from being assigned to a\n"
"channel by users that aren't IRC operators."));
else if (subcommand.equals_ci("MSG"))
source.Reply(BOT_HELP_SET_MSG);
source.Reply(_("Syntax: \002SET \037channel\037 MSG {\037OFF|PRIVMSG|NOTICE|NOTICEOPS\037}\002\n"
" \n"
"Configures how fantasy commands should be returned to the channel. Off disables\n"
"fantasy from replying to the channel. Privmsg, notice, and noticeops message the\n"
"channel, notice the channel, and notice the channel ops respectively.\n"
" \n"
"Note that replies over one line will not use this setting to prevent spam, and will\n"
"go directly to the user who executed it."));
else
return false;
@@ -230,12 +293,12 @@ class CommandBSSet : public Command
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "SET", BOT_SET_SYNTAX);
SyntaxError(source, "SET", _("SET \037(channel | bot)\037 \037option\037 \037settings\037"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(BOT_HELP_CMD_SET);
source.Reply(_(" SET Configures bot options"));
}
};
+14 -8
View File
@@ -28,38 +28,44 @@ class CommandBSUnassign : public Command
ChannelInfo *ci = source.ci;
if (readonly)
source.Reply(BOT_ASSIGN_READONLY);
source.Reply(LanguageString::BOT_ASSIGN_READONLY);
else if (!u->Account()->HasPriv("botserv/administration") && !check_access(u, ci, CA_ASSIGN))
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
else if (!ci->bi)
source.Reply(BOT_NOT_ASSIGNED);
source.Reply(LanguageString::BOT_NOT_ASSIGNED);
else if (ci->HasFlag(CI_PERSIST) && !cm)
source.Reply(BOT_UNASSIGN_PERSISTANT_CHAN);
source.Reply(_("You can not unassign bots while persist is set on the channel."));
else
{
bool override = !check_access(u, ci, CA_ASSIGN);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "for " << ci->bi->nick;
ci->bi->UnAssign(u, ci);
source.Reply(BOT_UNASSIGN_UNASSIGNED, ci->name.c_str());
source.Reply(_("There is no bot assigned to %s anymore."), ci->name.c_str());
}
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(BOT_HELP_UNASSIGN);
source.Reply(_("Syntax: \002UNASSIGN \037chan\037\002\n"
" \n"
"Unassigns a bot from a channel. When you use this command,\n"
"the bot won't join the channel anymore. However, bot\n"
"configuration for the channel is kept, so you will always\n"
"be able to reassign a bot later without have to reconfigure\n"
"it entirely."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "UNASSIGN", BOT_UNASSIGN_SYNTAX);
SyntaxError(source, "UNASSIGN", _("UNASSIGN \037chan\037"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(BOT_HELP_CMD_UNASSIGN);
source.Reply(_(" UNASSIGN Unassigns a bot from a channel"));
}
};
+151 -61
View File
@@ -26,9 +26,9 @@ class AccessListCallback : public NumberList
~AccessListCallback()
{
if (SentHeader)
source.Reply(CHAN_ACCESS_LIST_FOOTER, source.ci->name.c_str());
source.Reply(_("End of access list."), source.ci->name.c_str());
else
source.Reply(CHAN_ACCESS_NO_MATCH, source.ci->name.c_str());
source.Reply(_("No matching entries on %s access list."), source.ci->name.c_str());
}
virtual void HandleNumber(unsigned Number)
@@ -39,7 +39,7 @@ class AccessListCallback : public NumberList
if (!SentHeader)
{
SentHeader = true;
source.Reply(CHAN_ACCESS_LIST_HEADER, source.ci->name.c_str());
source.Reply(LanguageString::CHAN_ACCESS_LIST_HEADER, source.ci->name.c_str());
}
DoList(source, Number - 1, source.ci->GetAccess(Number - 1));
@@ -50,10 +50,10 @@ class AccessListCallback : public NumberList
if (source.ci->HasFlag(CI_XOP))
{
Anope::string xop = get_xop_level(access->level);
source.Reply(CHAN_ACCESS_LIST_XOP_FORMAT, Number + 1, xop.c_str(), access->mask.c_str());
source.Reply(_(" %3d %s %s"), Number + 1, xop.c_str(), access->mask.c_str());
}
else
source.Reply(CHAN_ACCESS_LIST_AXS_FORMAT, Number + 1, access->level, access->mask.c_str());
source.Reply(_(" %3d %4d %s"), Number + 1, access->level, access->mask.c_str());
}
};
@@ -72,7 +72,7 @@ class AccessViewCallback : public AccessListCallback
if (!SentHeader)
{
SentHeader = true;
source.Reply(CHAN_ACCESS_LIST_HEADER, source.ci->name.c_str());
source.Reply(LanguageString::CHAN_ACCESS_LIST_HEADER, source.ci->name.c_str());
}
DoList(source, Number - 1, source.ci->GetAccess(Number - 1));
@@ -92,10 +92,10 @@ class AccessViewCallback : public AccessListCallback
if (ci->HasFlag(CI_XOP))
{
Anope::string xop = get_xop_level(access->level);
source.Reply(CHAN_ACCESS_VIEW_XOP_FORMAT, Number + 1, xop.c_str(), access->mask.c_str(), access->creator.c_str(), timebuf.c_str());
source.Reply(LanguageString::CHAN_ACCESS_VIEW_XOP_FORMAT, Number + 1, xop.c_str(), access->mask.c_str(), access->creator.c_str(), timebuf.c_str());
}
else
source.Reply(CHAN_ACCESS_VIEW_AXS_FORMAT, Number + 1, access->level, access->mask.c_str(), access->creator.c_str(), timebuf.c_str());
source.Reply(LanguageString::CHAN_ACCESS_VIEW_AXS_FORMAT, Number + 1, access->level, access->mask.c_str(), access->creator.c_str(), timebuf.c_str());
}
};
@@ -117,17 +117,17 @@ class AccessDelCallback : public NumberList
~AccessDelCallback()
{
if (Denied && !Deleted)
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
else if (!Deleted)
source.Reply(CHAN_ACCESS_NO_MATCH, source.ci->name.c_str());
source.Reply(_("No matching entries on %s access list."), source.ci->name.c_str());
else
{
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source.u, c, source.ci) << "for user" << (Deleted == 1 ? " " : "s ") << Nicks;
if (Deleted == 1)
source.Reply(CHAN_ACCESS_DELETED_ONE, source.ci->name.c_str());
source.Reply(_("Deleted 1 entry from %s access list."), source.ci->name.c_str());
else
source.Reply(CHAN_ACCESS_DELETED_SEVERAL, Deleted, source.ci->name.c_str());
source.Reply(_("Deleted %d entries from %s access list."), Deleted, source.ci->name.c_str());
}
}
@@ -175,18 +175,18 @@ class CommandCSAccess : public Command
int16 u_level = u_access ? u_access->level : 0;
if (level >= u_level && !u->Account()->HasPriv("chanserv/access/modify"))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
if (!level)
{
source.Reply(CHAN_ACCESS_LEVEL_NONZERO);
source.Reply(_("Access level must be non-zero."));
return MOD_CONT;
}
else if (level <= ACCESS_INVALID || level >= ACCESS_FOUNDER)
{
source.Reply(CHAN_ACCESS_LEVEL_RANGE, ACCESS_INVALID + 1, ACCESS_FOUNDER - 1);
source.Reply(LanguageString::CHAN_ACCESS_LEVEL_RANGE, ACCESS_INVALID + 1, ACCESS_FOUNDER - 1);
return MOD_CONT;
}
@@ -197,7 +197,7 @@ class CommandCSAccess : public Command
mask += "!*@*";
else if (na && na->HasFlag(NS_FORBIDDEN))
{
source.Reply(NICK_X_FORBIDDEN, mask.c_str());
source.Reply(LanguageString::NICK_X_FORBIDDEN, mask.c_str());
return MOD_CONT;
}
@@ -207,12 +207,12 @@ class CommandCSAccess : public Command
/* Don't allow lowering from a level >= u_level */
if (access->level >= u_level && !u->Account()->HasPriv("chanserv/access/modify"))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
if (access->level == level)
{
source.Reply(CHAN_ACCESS_LEVEL_UNCHANGED, access->mask.c_str(), ci->name.c_str(), level);
source.Reply(_("Access level for \002%s\002 on %s unchanged from \002%d\002."), access->mask.c_str(), ci->name.c_str(), level);
return MOD_CONT;
}
access->level = level;
@@ -220,13 +220,13 @@ class CommandCSAccess : public Command
FOREACH_MOD(I_OnAccessChange, OnAccessChange(ci, u, access));
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "ADD " << mask << " (level: " << level << ") as level " << u_level;
source.Reply(CHAN_ACCESS_LEVEL_CHANGED, access->mask.c_str(), ci->name.c_str(), level);
source.Reply(_("Access level for \002%s\002 on %s changed to \002%d\002."), access->mask.c_str(), ci->name.c_str(), level);
return MOD_CONT;
}
if (ci->GetAccessCount() >= Config->CSAccessMax)
{
source.Reply(CHAN_ACCESS_REACHED_LIMIT, Config->CSAccessMax);
source.Reply(_("Sorry, you can only have %d access entries on a channel."), Config->CSAccessMax);
return MOD_CONT;
}
@@ -235,7 +235,7 @@ class CommandCSAccess : public Command
FOREACH_MOD(I_OnAccessAdd, OnAccessAdd(ci, u, access));
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "ADD " << mask << " (level: " << level << ") as level " << u_level;
source.Reply(CHAN_ACCESS_ADDED, access->mask.c_str(), ci->name.c_str(), level);
source.Reply(_("\002%s\002 added to %s access list at level \002%d\002."), access->mask.c_str(), ci->name.c_str(), level);
return MOD_CONT;
}
@@ -248,7 +248,7 @@ class CommandCSAccess : public Command
const Anope::string &mask = params[2];
if (!ci->GetAccessCount())
source.Reply(CHAN_ACCESS_LIST_EMPTY, ci->name.c_str());
source.Reply(_("%s access list is empty."), ci->name.c_str());
else if (isdigit(mask[0]) && mask.find_first_not_of("1234567890,-") == Anope::string::npos)
{
AccessDelCallback list(source, this, mask);
@@ -260,12 +260,12 @@ class CommandCSAccess : public Command
ChanAccess *u_access = ci->GetAccess(u);
int16 u_level = u_access ? u_access->level : 0;
if (!access)
source.Reply(CHAN_ACCESS_NOT_FOUND, mask.c_str(), ci->name.c_str());
source.Reply(_("\002%s\002 not found on %s access list."), mask.c_str(), ci->name.c_str());
else if (access->nc != u->Account() && check_access(u, ci, CA_NOJOIN) && u_level <= access->level && !u->Account()->HasPriv("chanserv/access/modify"))
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
else
{
source.Reply(CHAN_ACCESS_DELETED, access->mask.c_str(), ci->name.c_str());
source.Reply(_("\002%s\002 deleted from %s access list."), access->mask.c_str(), ci->name.c_str());
bool override = !check_access(u, ci, CA_ACCESS_CHANGE) && access->nc != u->Account();
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "DEL " << access->mask << " from level " << access->level;
@@ -285,7 +285,7 @@ class CommandCSAccess : public Command
const Anope::string &nick = params.size() > 2 ? params[2] : "";
if (!ci->GetAccessCount())
source.Reply(CHAN_ACCESS_LIST_EMPTY, ci->name.c_str());
source.Reply(_("%s access list is empty."), ci->name.c_str());
else if (!nick.empty() && nick.find_first_not_of("1234567890,-") == Anope::string::npos)
{
AccessListCallback list(source, nick);
@@ -305,16 +305,16 @@ class CommandCSAccess : public Command
if (!SentHeader)
{
SentHeader = true;
source.Reply(CHAN_ACCESS_LIST_HEADER, ci->name.c_str());
source.Reply(LanguageString::CHAN_ACCESS_LIST_HEADER, ci->name.c_str());
}
AccessListCallback::DoList(source, i, access);
}
if (SentHeader)
source.Reply(CHAN_ACCESS_LIST_FOOTER, ci->name.c_str());
source.Reply(_("End of access list."), ci->name.c_str());
else
source.Reply(CHAN_ACCESS_NO_MATCH, ci->name.c_str());
source.Reply(_("No matching entries on %s access list."), ci->name.c_str());
}
return MOD_CONT;
@@ -327,7 +327,7 @@ class CommandCSAccess : public Command
const Anope::string &nick = params.size() > 2 ? params[2] : "";
if (!ci->GetAccessCount())
source.Reply(CHAN_ACCESS_LIST_EMPTY, ci->name.c_str());
source.Reply(_("%s access list is empty."), ci->name.c_str());
else if (!nick.empty() && nick.find_first_not_of("1234567890,-") == Anope::string::npos)
{
AccessViewCallback list(source, nick);
@@ -347,16 +347,16 @@ class CommandCSAccess : public Command
if (!SentHeader)
{
SentHeader = true;
source.Reply(CHAN_ACCESS_LIST_HEADER, ci->name.c_str());
source.Reply(LanguageString::CHAN_ACCESS_LIST_HEADER, ci->name.c_str());
}
AccessViewCallback::DoList(source, i, access);
}
if (SentHeader)
source.Reply(CHAN_ACCESS_LIST_FOOTER, ci->name.c_str());
source.Reply(_("End of access list."), ci->name.c_str());
else
source.Reply(CHAN_ACCESS_NO_MATCH, ci->name.c_str());
source.Reply(_("No matching entries on %s access list."), ci->name.c_str());
}
return MOD_CONT;
@@ -368,14 +368,14 @@ class CommandCSAccess : public Command
ChannelInfo *ci = source.ci;
if (!IsFounder(u, ci) && !u->Account()->HasPriv("chanserv/access/modify"))
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
else
{
ci->ClearAccess();
FOREACH_MOD(I_OnAccessClear, OnAccessClear(ci, u));
source.Reply(CHAN_ACCESS_CLEAR, ci->name.c_str());
source.Reply(_("Channel %s access list has been cleared."), ci->name.c_str());
bool override = !IsFounder(u, ci);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "CLEAR";
@@ -420,17 +420,21 @@ class CommandCSAccess : public Command
if (is_list || is_clear ? 0 : (cmd.equals_ci("DEL") ? (nick.empty() || !s.empty()) : s.empty()))
this->OnSyntaxError(source, cmd);
else if (!has_access)
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
/* We still allow LIST and CLEAR in xOP mode, but not others */
else if (ci->HasFlag(CI_XOP) && !is_list && !is_clear)
{
if (ModeManager::FindChannelModeByName(CMODE_HALFOP))
source.Reply(CHAN_ACCESS_XOP_HOP, Config->s_ChanServ.c_str());
source.Reply(_("You can't use this command. \n"
"Use the AOP, SOP, HOP and VOP commands instead.\n"
"Type \002%R%s HELP \037command\037\002 for more information."), Config->s_ChanServ.c_str());
else
source.Reply(CHAN_ACCESS_XOP, Config->s_ChanServ.c_str());
source.Reply(_("You can't use this command. \n"
"Use the AOP, SOP and VOP commands instead.\n"
"Type \002%R%s HELP \037command\037\002 for more information."), Config->s_ChanServ.c_str());
}
else if (readonly && !is_list)
source.Reply(CHAN_ACCESS_DISABLED);
source.Reply(_("Sorry, channel access list modification is temporarily disabled."));
else if (cmd.equals_ci("ADD"))
this->DoAdd(source, params);
else if (cmd.equals_ci("DEL"))
@@ -449,14 +453,75 @@ class CommandCSAccess : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_ACCESS);
source.Reply(CHAN_HELP_ACCESS_LEVELS);
source.Reply(_("Syntax: \002ACCESS \037channel\037 ADD \037mask\037 \037level\037\002\n"
" \002ACCESS \037channel\037 DEL {\037mask\037 | \037entry-num\037 | \037list\037}\002\n"
" \002ACCESS \037channel\037 LIST [\037mask\037 | \037list\037]\002\n"
" \002ACCESS \037channel\037 VIEW [\037mask\037 | \037list\037]\002\n"
" \002ACCESS \037channel\037 CLEAR\002\n"
" \n"
"Maintains the \002access list\002 for a channel. The access\n"
"list specifies which users are allowed chanop status or\n"
"access to %S commands on the channel. Different\n"
"user levels allow for access to different subsets of\n"
"privileges; \002%R%S HELP ACCESS LEVELS\002 for more\n"
"specific information. Any nick not on the access list has\n"
"a user level of 0.\n"
" \n"
"The \002ACCESS ADD\002 command adds the given mask to the\n"
"access list with the given user level; if the mask is\n"
"already present on the list, its access level is changed to\n"
"the level specified in the command. The \037level\037 specified\n"
"must be less than that of the user giving the command, and\n"
"if the \037mask\037 is already on the access list, the current\n"
"access level of that nick must be less than the access level\n"
"of the user giving the command. When a user joins the channel\n"
"the access they receive is from the highest level entry in the\n"
"access list.\n"
" \n"
"The \002ACCESS DEL\002 command removes the given nick from the\n"
"access list. If a list of entry numbers is given, those\n"
"entries are deleted. (See the example for LIST below.)\n"
"You may remove yourself from an access list, even if you\n"
"do not have access to modify that list otherwise.\n"
" \n"
"The \002ACCESS LIST\002 command displays the access list. If\n"
"a wildcard mask is given, only those entries matching the\n"
"mask are displayed. If a list of entry numbers is given,\n"
"only those entries are shown; for example:\n"
" \002ACCESS #channel LIST 2-5,7-9\002\n"
" Lists access entries numbered 2 through 5 and\n"
" 7 through 9.\n"
" \n"
"The \002ACCESS VIEW\002 command displays the access list similar\n"
"to \002ACCESS LIST\002 but shows the creator and last used time.\n"
" \n"
"The \002ACCESS CLEAR\002 command clears all entries of the\n"
"access list."));
source.Reply(_("\002User access levels\002\n"
" \n"
"By default, the following access levels are defined:\n"
" \n"
" \002Founder\002 Full access to %S functions; automatic\n"
" opping upon entering channel. Note\n"
" that only one person may have founder\n"
" status (it cannot be given using the\n"
" \002ACCESS\002 command).\n"
" \002 10\002 Access to AKICK command; automatic opping.\n"
" \002 5\002 Automatic opping.\n"
" \002 3\002 Automatic voicing.\n"
" \002 0\002 No special privileges; can be opped by other\n"
" ops (unless \002secure-ops\002 is set).\n"
" \002 <0\002 May not be opped.\n"
" \n"
"These levels may be changed, or new ones added, using the\n"
"\002LEVELS\002 command; type \002%R%S HELP LEVELS\002 for\n"
"information."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "ACCESS", CHAN_ACCESS_SYNTAX);
SyntaxError(source, "ACCESS", _("ACCESS \037channel\037 {ADD|DEL|LIST|VIEW|CLEAR} [\037mask\037 [\037level\037] | \037entry-list\037]"));
}
};
@@ -484,7 +549,7 @@ class CommandCSLevels : public Command
if (!error.empty())
this->OnSyntaxError(source, "SET");
else if (level <= ACCESS_INVALID || level > ACCESS_FOUNDER)
source.Reply(CHAN_LEVELS_RANGE, ACCESS_INVALID + 1, ACCESS_FOUNDER - 1);
source.Reply(_("Level must be between %d and %d inclusive."), ACCESS_INVALID + 1, ACCESS_FOUNDER - 1);
else
{
for (int i = 0; levelinfo[i].what >= 0; ++i)
@@ -498,14 +563,14 @@ class CommandCSLevels : public Command
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "SET " << levelinfo[i].name << " to " << level;
if (level == ACCESS_FOUNDER)
source.Reply(CHAN_LEVELS_CHANGED_FOUNDER, levelinfo[i].name.c_str(), ci->name.c_str());
source.Reply(_("Level for %s on channel %s changed to founder only."), levelinfo[i].name.c_str(), ci->name.c_str());
else
source.Reply(CHAN_LEVELS_CHANGED, levelinfo[i].name.c_str(), ci->name.c_str(), level);
source.Reply(_("Level for \002%s\002 on channel %s changed to \002%d\002."), levelinfo[i].name.c_str(), ci->name.c_str(), level);
return MOD_CONT;
}
}
source.Reply(CHAN_LEVELS_UNKNOWN, what.c_str(), Config->s_ChanServ.c_str());
source.Reply(_("Setting \002%s\002 not known. Type \002%R%s HELP LEVELS \002 for a list of valid settings."), what.c_str(), Config->s_ChanServ.c_str());
}
return MOD_CONT;
@@ -530,12 +595,12 @@ class CommandCSLevels : public Command
bool override = !check_access(u, ci, CA_FOUNDER);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "DISABLE " << levelinfo[i].name;
source.Reply(CHAN_LEVELS_DISABLED, levelinfo[i].name.c_str(), ci->name.c_str());
source.Reply(_("\002%s\002 disabled on channel %s."), levelinfo[i].name.c_str(), ci->name.c_str());
return MOD_CONT;
}
}
source.Reply(CHAN_LEVELS_UNKNOWN, what.c_str(), Config->s_ChanServ.c_str());
source.Reply(_("Setting \002%s\002 not known. Type \002%R%s HELP LEVELS \002 for a list of valid settings."), what.c_str(), Config->s_ChanServ.c_str());
return MOD_CONT;
}
@@ -544,7 +609,7 @@ class CommandCSLevels : public Command
{
ChannelInfo *ci = source.ci;
source.Reply(CHAN_LEVELS_LIST_HEADER, ci->name.c_str());
source.Reply(_("Access level settings for channel %s:"), ci->name.c_str());
if (!levelinfo_maxwidth)
for (int i = 0; levelinfo[i].what >= 0; ++i)
@@ -562,12 +627,12 @@ class CommandCSLevels : public Command
{
j = levelinfo[i].what;
source.Reply(CHAN_LEVELS_LIST_DISABLED, levelinfo_maxwidth, levelinfo[i].name.c_str());
source.Reply(_(" %-*s (disabled)"), levelinfo_maxwidth, levelinfo[i].name.c_str());
}
else if (j == ACCESS_FOUNDER)
source.Reply(CHAN_LEVELS_LIST_FOUNDER, levelinfo_maxwidth, levelinfo[i].name.c_str());
source.Reply(_(" %-*s (founder only)"), levelinfo_maxwidth, levelinfo[i].name.c_str());
else
source.Reply(CHAN_LEVELS_LIST_NORMAL, levelinfo_maxwidth, levelinfo[i].name.c_str(), j);
source.Reply(_(" %-*s %d"), levelinfo_maxwidth, levelinfo[i].name.c_str(), j);
}
return MOD_CONT;
@@ -584,7 +649,7 @@ class CommandCSLevels : public Command
bool override = !check_access(u, ci, CA_FOUNDER);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "RESET";
source.Reply(CHAN_LEVELS_RESET, ci->name.c_str());
source.Reply(_("Access levels for \002%s\002 reset to defaults."), ci->name.c_str());
return MOD_CONT;
}
@@ -608,9 +673,9 @@ class CommandCSLevels : public Command
if (cmd.equals_ci("SET") ? s.empty() : (cmd.substr(0, 3).equals_ci("DIS") ? (what.empty() || !s.empty()) : !what.empty()))
this->OnSyntaxError(source, cmd);
else if (ci->HasFlag(CI_XOP))
source.Reply(CHAN_LEVELS_XOP);
source.Reply(_("Levels are not available as xOP is enabled on this channel."));
else if (!check_access(u, ci, CA_FOUNDER) && !u->Account()->HasPriv("chanserv/access/modify"))
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
else if (cmd.equals_ci("SET"))
this->DoSet(source, params);
else if (cmd.equals_ci("DIS") || cmd.equals_ci("DISABLE"))
@@ -630,7 +695,9 @@ class CommandCSLevels : public Command
if (subcommand.equals_ci("DESC"))
{
int i;
source.Reply(CHAN_HELP_LEVELS_DESC);
source.Reply(_("The following feature/function names are understood. Note\n"
"that the leves for NOJOIN is the maximum level,\n"
"while all others are minimum levels."));
if (!levelinfo_maxwidth)
for (i = 0; levelinfo[i].what >= 0; ++i)
{
@@ -639,22 +706,45 @@ class CommandCSLevels : public Command
levelinfo_maxwidth = len;
}
for (i = 0; levelinfo[i].what >= 0; ++i)
source.Reply(CHAN_HELP_LEVELS_DESC_FORMAT, levelinfo_maxwidth, levelinfo[i].name.c_str(), GetString(source.u, levelinfo[i].desc).c_str());
source.Reply(_(" %-*s %s"), levelinfo_maxwidth, levelinfo[i].name.c_str(), GetString(source.u->Account(), levelinfo[i].desc).c_str());
}
else
source.Reply(CHAN_HELP_LEVELS);
source.Reply(_("Syntax: \002LEVELS \037channel\037 SET \037type\037 \037level\037\002\n"
" \002LEVELS \037channel\037 {DIS | DISABLE} \037type\037\002\n"
" \002LEVELS \037channel\037 LIST\002\n"
" \002LEVELS \037channel\037 RESET\002\n"
" \n"
"The \002LEVELS\002 command allows fine control over the meaning of\n"
"the numeric access levels used for channels. With this\n"
"command, you can define the access level required for most\n"
"of %S's functions. (The \002SET FOUNDER\002 and this command\n"
"are always restricted to the channel founder.)\n"
" \n"
"\002LEVELS SET\002 allows the access level for a function or group of\n"
"functions to be changed. \002LEVELS DISABLE\002 (or \002DIS\002 for short)\n"
"disables an automatic feature or disallows access to a\n"
"function by anyone, INCLUDING the founder (although, the founder\n"
"can always reenable it).\n"
" \n"
"\002LEVELS LIST\002 shows the current levels for each function or\n"
"group of functions. \002LEVELS RESET\002 resets the levels to the\n"
"default levels of a newly-created channel (see\n"
"\002HELP ACCESS LEVELS\002).\n"
" \n"
"For a list of the features and functions whose levels can be\n"
"set, see \002HELP LEVELS DESC\002."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "LEVELS", CHAN_LEVELS_SYNTAX);
SyntaxError(source, "LEVELS", _("LEVELS \037channel\037 {SET | DIS[ABLE] | LIST | RESET} [\037item\037 [\037level\037]]"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_ACCESS);
source.Reply(CHAN_HELP_CMD_LEVELS);
source.Reply(_(" ACCESS Modify the list of privileged users"));
source.Reply(_(" LEVELS Redefine the meanings of access levels"));
}
};
+73 -35
View File
@@ -64,7 +64,7 @@ class AkickListCallback : public NumberList
~AkickListCallback()
{
if (!SentHeader)
source.Reply(CHAN_AKICK_NO_MATCH, source.ci->name.c_str());
source.Reply(_("No matching entries on %s autokick list."), source.ci->name.c_str());
}
virtual void HandleNumber(unsigned Number)
@@ -75,7 +75,7 @@ class AkickListCallback : public NumberList
if (!SentHeader)
{
SentHeader = true;
source.Reply(CHAN_AKICK_LIST_HEADER, source.ci->name.c_str());
source.Reply(_("Autokick list for %s:"), source.ci->name.c_str());
}
DoList(source, Number - 1, source.ci->GetAkick(Number - 1));
@@ -83,7 +83,7 @@ class AkickListCallback : public NumberList
static void DoList(CommandSource &source, unsigned index, AutoKick *akick)
{
source.Reply(CHAN_AKICK_LIST_FORMAT, index + 1, akick->HasFlag(AK_ISNICK) ? akick->nc->display.c_str() : akick->mask.c_str(), !akick->reason.empty() ? akick->reason.c_str() : GetString(source.u, NO_REASON).c_str());
source.Reply(_(" %3d %s (%s)"), index + 1, akick->HasFlag(AK_ISNICK) ? akick->nc->display.c_str() : akick->mask.c_str(), !akick->reason.empty() ? akick->reason.c_str() : GetString(source.u->Account(), LanguageString::NO_REASON).c_str());
}
};
@@ -102,7 +102,7 @@ class AkickViewCallback : public AkickListCallback
if (!SentHeader)
{
SentHeader = true;
source.Reply(CHAN_AKICK_LIST_HEADER, source.ci->name.c_str());
source.Reply(_("Autokick list for %s:"), source.ci->name.c_str());
}
DoList(source, Number - 1, source.ci->GetAkick(Number - 1));
@@ -116,12 +116,12 @@ class AkickViewCallback : public AkickListCallback
if (akick->addtime)
timebuf = do_strftime(akick->addtime);
else
timebuf = GetString(u, UNKNOWN);
timebuf = GetString(u->Account(), LanguageString::UNKNOWN);
source.Reply(CHAN_AKICK_VIEW_FORMAT, index + 1, akick->HasFlag(AK_ISNICK) ? akick->nc->display.c_str() : akick->mask.c_str(), !akick->creator.empty() ? akick->creator.c_str() : GetString(u, UNKNOWN).c_str(), timebuf.c_str(), !akick->reason.empty() ? akick->reason.c_str() : GetString(u, NO_REASON).c_str());
source.Reply(LanguageString::CHAN_AKICK_VIEW_FORMAT, index + 1, akick->HasFlag(AK_ISNICK) ? akick->nc->display.c_str() : akick->mask.c_str(), !akick->creator.empty() ? akick->creator.c_str() : GetString(u->Account(), LanguageString::UNKNOWN).c_str(), timebuf.c_str(), !akick->reason.empty() ? akick->reason.c_str() : GetString(u->Account(), LanguageString::NO_REASON).c_str());
if (akick->last_used)
source.Reply(CHAN_AKICK_LAST_USED, do_strftime(akick->last_used).c_str());
source.Reply(_(" Last used %s"), do_strftime(akick->last_used).c_str());
}
};
@@ -143,11 +143,11 @@ class AkickDelCallback : public NumberList
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, c, ci) << "DEL on " << Deleted << " users";
if (!Deleted)
source.Reply(CHAN_AKICK_NO_MATCH, ci->name.c_str());
source.Reply(_("No matching entries on %s autokick list."), ci->name.c_str());
else if (Deleted == 1)
source.Reply(CHAN_AKICK_DELETED_ONE, ci->name.c_str());
source.Reply(_("Deleted 1 entry from %s autokick list."), ci->name.c_str());
else
source.Reply(CHAN_AKICK_DELETED_SEVERAL, Deleted, ci->name.c_str());
source.Reply(_("Deleted %d entries from %s autokick list."), Deleted, ci->name.c_str());
}
void HandleNumber(unsigned Number)
@@ -184,7 +184,7 @@ class CommandCSAKick : public Command
{
if (na->HasFlag(NS_FORBIDDEN))
{
source.Reply(NICK_X_FORBIDDEN, mask.c_str());
source.Reply(LanguageString::NICK_X_FORBIDDEN, mask.c_str());
return;
}
@@ -194,7 +194,7 @@ class CommandCSAKick : public Command
/* Check excepts BEFORE we get this far */
if (ModeManager::FindChannelModeByName(CMODE_EXCEPT) && is_excepted_mask(ci, mask))
{
source.Reply(CHAN_EXCEPTED, mask.c_str(), ci->name.c_str());
source.Reply(LanguageString::CHAN_EXCEPTED, mask.c_str(), ci->name.c_str());
return;
}
@@ -206,7 +206,7 @@ class CommandCSAKick : public Command
int16 nc_level = nc_access ? nc_access->level : 0, u_level = u_access ? u_access->level : 0;
if (nc == ci->founder || nc_level >= u_level)
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return;
}
}
@@ -224,7 +224,7 @@ class CommandCSAKick : public Command
if ((check_access(u2, ci, CA_FOUNDER) || u2_level >= u_level) && entry_mask.Matches(u2))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return;
}
}
@@ -245,7 +245,7 @@ class CommandCSAKick : public Command
Anope::string buf = na2->nick + "!" + na2->last_usermask;
if (Anope::Match(buf, mask))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return;
}
}
@@ -257,14 +257,14 @@ class CommandCSAKick : public Command
akick = ci->GetAkick(j);
if (akick->HasFlag(AK_ISNICK) ? akick->nc == nc : mask.equals_ci(akick->mask))
{
source.Reply(CHAN_AKICK_ALREADY_EXISTS, akick->HasFlag(AK_ISNICK) ? akick->nc->display.c_str() : akick->mask.c_str(), ci->name.c_str());
source.Reply(_("\002%s\002 already exists on %s autokick list."), akick->HasFlag(AK_ISNICK) ? akick->nc->display.c_str() : akick->mask.c_str(), ci->name.c_str());
return;
}
}
if (ci->GetAkickCount() >= Config->CSAutokickMax)
{
source.Reply(CHAN_AKICK_REACHED_LIMIT, Config->CSAutokickMax);
source.Reply(_("Sorry, you can only have %d autokick masks on a channel."), Config->CSAutokickMax);
return;
}
@@ -278,7 +278,7 @@ class CommandCSAKick : public Command
FOREACH_MOD(I_OnAkickAdd, OnAkickAdd(u, ci, akick));
source.Reply(CHAN_AKICK_ADDED, mask.c_str(), ci->name.c_str());
source.Reply(_("\002%s\002 added to %s autokick list."), mask.c_str(), ci->name.c_str());
this->DoEnforce(source);
}
@@ -294,7 +294,7 @@ class CommandCSAKick : public Command
if (!ci->GetAkickCount())
{
source.Reply(CHAN_AKICK_LIST_EMPTY, ci->name.c_str());
source.Reply(_("%s autokick list is empty."), ci->name.c_str());
return;
}
@@ -319,7 +319,7 @@ class CommandCSAKick : public Command
if (i == ci->GetAkickCount())
{
source.Reply(CHAN_AKICK_NOT_FOUND, mask.c_str(), ci->name.c_str());
source.Reply(_("\002%s\002 not found on %s autokick list."), mask.c_str(), ci->name.c_str());
return;
}
@@ -328,7 +328,7 @@ class CommandCSAKick : public Command
ci->EraseAkick(i);
source.Reply(CHAN_AKICK_DELETED, mask.c_str(), ci->name.c_str());
source.Reply(_("\002%s\002 deleted from %s autokick list."), mask.c_str(), ci->name.c_str());
}
}
@@ -344,7 +344,7 @@ class CommandCSAKick : public Command
if (!ci->GetAkickCount())
{
source.Reply(CHAN_AKICK_LIST_EMPTY, ci->name.c_str());
source.Reply(_("%s autokick list is empty."), ci->name.c_str());
return;
}
@@ -372,14 +372,14 @@ class CommandCSAKick : public Command
if (!SentHeader)
{
SentHeader = true;
source.Reply(CHAN_AKICK_LIST_HEADER, ci->name.c_str());
source.Reply(_("Autokick list for %s:"), ci->name.c_str());
}
AkickListCallback::DoList(source, i, akick);
}
if (!SentHeader)
source.Reply(CHAN_AKICK_NO_MATCH, ci->name.c_str());
source.Reply(_("No matching entries on %s autokick list."), ci->name.c_str());
}
}
@@ -395,7 +395,7 @@ class CommandCSAKick : public Command
if (!ci->GetAkickCount())
{
source.Reply(CHAN_AKICK_LIST_EMPTY, ci->name.c_str());
source.Reply(_("%s autokick list is empty."), ci->name.c_str());
return;
}
@@ -423,14 +423,14 @@ class CommandCSAKick : public Command
if (!SentHeader)
{
SentHeader = true;
source.Reply(CHAN_AKICK_LIST_HEADER, ci->name.c_str());
source.Reply(_("Autokick list for %s:"), ci->name.c_str());
}
AkickViewCallback::DoList(source, i, akick);
}
if (!SentHeader)
source.Reply(CHAN_AKICK_NO_MATCH, ci->name.c_str());
source.Reply(_("No matching entries on %s autokick list."), ci->name.c_str());
}
}
@@ -443,7 +443,7 @@ class CommandCSAKick : public Command
if (!c)
{
source.Reply(CHAN_X_NOT_IN_USE, ci->name.c_str());
source.Reply(LanguageString::CHAN_X_NOT_IN_USE, ci->name.c_str());
return;
}
@@ -458,7 +458,7 @@ class CommandCSAKick : public Command
bool override = !check_access(u, ci, CA_AKICK);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "ENFORCE, affects " << count << " users";
source.Reply(CHAN_AKICK_ENFORCE_DONE, ci->name.c_str(), count);
source.Reply(_("AKICK ENFORCE for \002%s\002 complete; \002%d\002 users were affected."), ci->name.c_str(), count);
}
void DoClear(CommandSource &source)
@@ -469,7 +469,7 @@ class CommandCSAKick : public Command
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "CLEAR";
ci->ClearAkick();
source.Reply(CHAN_AKICK_CLEAR, ci->name.c_str());
source.Reply(_("Channel %s akick list has been cleared."), ci->name.c_str());
}
public:
@@ -489,9 +489,9 @@ class CommandCSAKick : public Command
if (mask.empty() && (cmd.equals_ci("ADD") || cmd.equals_ci("DEL")))
this->OnSyntaxError(source, cmd);
else if (!check_access(u, ci, CA_AKICK) && !u->Account()->HasPriv("chanserv/access/modify"))
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
else if (!cmd.equals_ci("LIST") && !cmd.equals_ci("VIEW") && !cmd.equals_ci("ENFORCE") && readonly)
source.Reply(CHAN_AKICK_DISABLED);
source.Reply(_("Sorry, channel autokick list modification is temporarily disabled."));
else if (cmd.equals_ci("ADD"))
this->DoAdd(source, params);
else if (cmd.equals_ci("DEL"))
@@ -512,18 +512,56 @@ class CommandCSAKick : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_AKICK);
source.Reply(_("Syntax: \002AKICK \037channel\037 ADD {\037nick\037 | \037mask\037} [\037reason\037]\002\n"
" \002AKICK \037channel\037 DEL {\037nick\037 | \037mask\037 | \037entry-num\037 | \037list\037}\002\n"
" \002AKICK \037channel\037 LIST [\037mask\037 | \037entry-num\037 | \037list\037]\002\n"
" \002AKICK \037channel\037 VIEW [\037mask\037 | \037entry-num\037 | \037list\037]\002\n"
" \002AKICK \037channel\037 ENFORCE\002\n"
" \002AKICK \037channel\037 CLEAR\002\n"
" \n"
"Maintains the \002AutoKick list\002 for a channel. If a user\n"
"on the AutoKick list attempts to join the channel,\n"
"%S will ban that user from the channel, then kick\n"
"the user.\n"
" \n"
"The \002AKICK ADD\002 command adds the given nick or usermask\n"
"to the AutoKick list. If a \037reason\037 is given with\n"
"the command, that reason will be used when the user is\n"
"kicked; if not, the default reason is \"You have been\n"
"banned from the channel\".\n"
"When akicking a \037registered nick\037 the nickserv account\n"
"will be added to the akick list instead of the mask.\n"
"All users within that nickgroup will then be akicked.\n"
" \n"
"The \002AKICK DEL\002 command removes the given nick or mask\n"
"from the AutoKick list. It does not, however, remove any\n"
"bans placed by an AutoKick; those must be removed\n"
"manually.\n"
" \n"
"The \002AKICK LIST\002 command displays the AutoKick list, or\n"
"optionally only those AutoKick entries which match the\n"
"given mask.\n"
" \n"
"The \002AKICK VIEW\002 command is a more verbose version of\n"
"\002AKICK LIST\002 command.\n"
" \n"
"The \002AKICK ENFORCE\002 command causes %S to enforce the\n"
"current AKICK list by removing those users who match an\n"
"AKICK mask.\n"
" \n"
"The \002AKICK CLEAR\002 command clears all entries of the\n"
"akick list."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "AKICK", CHAN_AKICK_SYNTAX);
SyntaxError(source, "AKICK", _("AKICK \037channel\037 {ADD | DEL | LIST | VIEW | ENFORCE | CLEAR} [\037nick-or-usermask\037] [\037reason\037]"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_AKICK);
source.Reply(_(" AKICK Maintain the AutoKick list"));
}
};
+14 -9
View File
@@ -36,21 +36,21 @@ class CommandCSBan : public Command
uint16 u_level = u_access ? u_access->level : 0, u2_level = u2_access ? u2_access->level : 0;
if (!c)
source.Reply(CHAN_X_NOT_IN_USE, chan.c_str());
source.Reply(LanguageString::CHAN_X_NOT_IN_USE, chan.c_str());
else if (!u2)
source.Reply(NICK_X_NOT_IN_USE, target.c_str());
source.Reply(LanguageString::NICK_X_NOT_IN_USE, target.c_str());
else if (!is_same ? !check_access(u, ci, CA_BAN) : !check_access(u, ci, CA_BANME))
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
else if (!is_same && ci->HasFlag(CI_PEACE) && u2_level >= u_level)
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
/*
* Dont ban/kick the user on channels where he is excepted
* to prevent services <-> server wars.
*/
else if (matches_list(ci->c, u2, CMODE_EXCEPT))
source.Reply(CHAN_EXCEPTED, u2->nick.c_str(), ci->name.c_str());
source.Reply(LanguageString::CHAN_EXCEPTED, u2->nick.c_str(), ci->name.c_str());
else if (u2->IsProtected())
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
else
{
Anope::string mask;
@@ -76,18 +76,23 @@ class CommandCSBan : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_BAN);
source.Reply(_("Syntax: \002BAN \037#channel\037 \037nick\037 [\037reason\037]\002\n"
" \n"
"Bans a selected nick on a channel.\n"
" \n"
"By default, limited to AOPs or those with level 5 access \n"
"and above on the channel."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "BAN", CHAN_BAN_SYNTAX);
SyntaxError(source, "BAN", _("BAN \037#channel\037 \037nick\037 [\037reason\037]"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_BAN);
source.Reply(_(" BAN Bans a selected nick on a channel"));
}
};
+11 -6
View File
@@ -31,9 +31,9 @@ class CommandCSClearUsers : public Command
Anope::string modebuf;
if (!c)
source.Reply(CHAN_X_NOT_IN_USE, chan.c_str());
source.Reply(LanguageString::CHAN_X_NOT_IN_USE, chan.c_str());
else if (!check_access(u, ci, CA_FOUNDER))
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
Anope::string buf = "CLEARUSERS command from " + u->nick + " (" + u->Account()->display + ")";
@@ -44,25 +44,30 @@ class CommandCSClearUsers : public Command
c->Kick(NULL, uc->user, "%s", buf.c_str());
}
source.Reply(CHAN_CLEARED_USERS, chan.c_str());
source.Reply(_("All users have been kicked from \2%s\2."), chan.c_str());
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_CLEARUSERS);
source.Reply(_("Syntax: \002CLEARUSERS \037channel\037\002\n"
" \n"
"Tells %S to clear (kick) all users certain settings on a channel."
" \n"
"By default, limited to those with founder access on the\n"
"channel."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "CLEAR", CHAN_CLEARUSERS_SYNTAX);
SyntaxError(source, "CLEAR", _("CLEARUSERS \037channel\037"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_CLEARUSERS);
source.Reply(_(" CLEARUSERS Tells ChanServ to clear (kick) all users on a channel"));
}
};
+16 -11
View File
@@ -31,24 +31,24 @@ public:
if (!check_access(u, ci, CA_SET))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
ChannelInfo *target_ci = cs_findchan(target);
if (!target_ci)
{
source.Reply(CHAN_X_NOT_REGISTERED, target.c_str());
source.Reply(LanguageString::CHAN_X_NOT_REGISTERED, target.c_str());
return MOD_CONT;
}
if (!IsFounder(u, ci) || !IsFounder(u, target_ci))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
if (Config->CSMaxReg && u->Account()->channelcount >= Config->CSMaxReg && !u->Account()->HasPriv("chanserv/no-register-limit"))
{
source.Reply(u->Account()->channelcount > Config->CSMaxReg ? CHAN_EXCEEDED_CHANNEL_LIMIT : CHAN_REACHED_CHANNEL_LIMIT, Config->CSMaxReg);
source.Reply(u->Account()->channelcount > Config->CSMaxReg ? LanguageString::CHAN_EXCEEDED_CHANNEL_LIMIT : LanguageString::CHAN_REACHED_CHANNEL_LIMIT, Config->CSMaxReg);
return MOD_CONT;
}
@@ -100,7 +100,7 @@ public:
FOREACH_MOD(I_OnChanRegistered, OnChanRegistered(target_ci));
source.Reply(CHAN_CLONED, channel.c_str(), target.c_str());
source.Reply(_("All settings from \002%s\002 have been transferred to \002%s\002"), channel.c_str(), target.c_str());
}
else if (what.equals_ci("ACCESS"))
{
@@ -111,7 +111,7 @@ public:
target_ci->AddAccess(access->mask, access->level, access->creator, access->last_seen);
}
source.Reply(CHAN_CLONED_ACCESS, channel.c_str(), target.c_str());
source.Reply(_("All access entries from \002%s\002 have been transferred to \002%s\002"), channel.c_str(), target.c_str());
}
else if (what.equals_ci("AKICK"))
{
@@ -125,7 +125,7 @@ public:
target_ci->AddAkick(akick->creator, akick->mask, akick->reason, akick->addtime, akick->last_used);
}
source.Reply(CHAN_CLONED_AKICK, channel.c_str(), target.c_str());
source.Reply(_("All akick entries from \002%s\002 have been transferred to \002%s\002"), channel.c_str(), target.c_str());
}
else if (what.equals_ci("BADWORDS"))
{
@@ -136,7 +136,7 @@ public:
target_ci->AddBadWord(bw->word, bw->type);
}
source.Reply(CHAN_CLONED_BADWORDS, channel.c_str(), target.c_str());
source.Reply(_("All badword entries from \002%s\002 have been transferred to \002%s\002"), channel.c_str(), target.c_str());
}
else
{
@@ -151,18 +151,23 @@ public:
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_CLONE);
source.Reply(_("Syntax: \002CLONE \037channel\037 \037target\037 [all | access | akick | badwords]\002\n"
" \n"
"Copies all settings, access, akicks, etc from channel to the\n"
"target channel. If access, akick, or badwords is specified then only\n"
"the respective settings are transferred. You must have founder level\n"
"access to \037channel\037 and \037target\037."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "CLONE", CHAN_CLONE_SYNTAX);
SyntaxError(source, "CLONE", _("CLONE \037channel\037 \037target\037"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_CLONE);
source.Reply(_(" CLONE Copy all settings from one channel to another"));
}
};
+15 -9
View File
@@ -31,7 +31,7 @@ class CommandCSDrop : public Command
if (readonly)
{
source.Reply(CHAN_DROP_DISABLED); // XXX: READ_ONLY_MODE?
source.Reply(_("Sorry, channel de-registration is temporarily disabled.")); // XXX: READ_ONLY_MODE?
return MOD_CONT;
}
@@ -39,19 +39,19 @@ class CommandCSDrop : public Command
if (ci->HasFlag(CI_FORBIDDEN) && !u->Account()->HasCommand("chanserv/drop"))
{
source.Reply(CHAN_X_FORBIDDEN, chan.c_str());
source.Reply(LanguageString::CHAN_X_FORBIDDEN, chan.c_str());
return MOD_CONT;
}
if (ci->HasFlag(CI_SUSPENDED) && !u->Account()->HasCommand("chanserv/drop"))
{
source.Reply(CHAN_X_FORBIDDEN, chan.c_str());
source.Reply(LanguageString::CHAN_X_FORBIDDEN, chan.c_str());
return MOD_CONT;
}
if ((ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !check_access(u, ci, CA_FOUNDER)) && !u->Account()->HasCommand("chanserv/drop"))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
@@ -71,7 +71,7 @@ class CommandCSDrop : public Command
delete ci;
source.Reply(CHAN_DROPPED, chan.c_str());
source.Reply(_("Channel \002%s\002 has been dropped."), chan.c_str());
FOREACH_MOD(I_OnChanDrop, OnChanDrop(chan));
@@ -82,21 +82,27 @@ class CommandCSDrop : public Command
{
User *u = source.u;
if (u->Account() && u->Account()->IsServicesOper())
source.Reply(CHAN_SERVADMIN_HELP_DROP);
source.Reply(_("Syntax: \002DROP \037channel\037\002\n"
" \n"
"Unregisters the named channel. Only \002Services Operators\002\n"
"can drop a channel for which they have not identified."));
else
source.Reply(CHAN_HELP_DROP);
source.Reply(_("Syntax: \002DROP \037channel\037\002\n"
" \n"
"Unregisters the named channel. Can only be used by\n"
"\002channel founder\002."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "DROP", CHAN_DROP_SYNTAX);
SyntaxError(source, "DROP", _("DROP \037channel\037"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_DROP);
source.Reply(_(" DROP Cancel the registration of a channel"));
}
};
+13 -8
View File
@@ -31,19 +31,19 @@ class CommandCSForbid : public Command
if (Config->ForceForbidReason && reason.empty())
{
SyntaxError(source, "FORBID", CHAN_FORBID_SYNTAX_REASON);
SyntaxError(source, "FORBID", _("FORBID \037channel\037 \037reason\037"));
return MOD_CONT;
}
if (chan[0] != '#')
{
source.Reply(CHAN_SYMBOL_REQUIRED);
source.Reply(LanguageString::CHAN_SYMBOL_REQUIRED);
return MOD_CONT;
}
if (readonly)
{
source.Reply(READ_ONLY_MODE);
source.Reply(LanguageString::READ_ONLY_MODE);
return MOD_CONT;
}
@@ -74,7 +74,7 @@ class CommandCSForbid : public Command
if (uc->user->HasMode(UMODE_OPER))
continue;
c->Kick(ChanServ, uc->user, "%s", !reason.empty() ? reason.c_str() : GetString(uc->user, CHAN_FORBID_REASON).c_str());
c->Kick(ChanServ, uc->user, "%s", !reason.empty() ? reason.c_str() : GetString(uc->user->Account(), _("This channel has been forbidden.")).c_str());
}
}
@@ -88,7 +88,7 @@ class CommandCSForbid : public Command
ircdproto->SendGlobops(ChanServ, "\2%s\2 used FORBID on channel \2%s\2", u->nick.c_str(), ci->name.c_str());
Log(LOG_ADMIN, u, this, ci) << (!ci->forbidreason.empty() ? ci->forbidreason : "No reason");
source.Reply(CHAN_FORBID_SUCCEEDED, chan.c_str());
source.Reply(_("Channel \002%s\002 is now forbidden."), chan.c_str());
FOREACH_MOD(I_OnChanForbidden, OnChanForbidden(ci));
@@ -97,18 +97,23 @@ class CommandCSForbid : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_SERVADMIN_HELP_FORBID);
source.Reply(_("Syntax: \002FORBID \037channel\037 [\037reason\037]\002\n"
" \n"
"Disallows anyone from registering or using the given\n"
"channel. May be cancelled by dropping the channel.\n"
" \n"
"Reason may be required on certain networks."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "FORBID", CHAN_FORBID_SYNTAX);
SyntaxError(source, "FORBID", _("FORBID \037channel\037 [\037reason\037]"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_FORBID);
source.Reply(_(" FORBID Prevent a channel from being used"));
}
};
+8 -6
View File
@@ -29,38 +29,40 @@ class CommandCSGetKey : public Command
if (!check_access(u, ci, CA_GETKEY) && !u->Account()->HasCommand("chanserv/getkey"))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
Anope::string key;
if (!ci->c || !ci->c->GetParam(CMODE_KEY, key))
{
source.Reply(CHAN_GETKEY_NOKEY, chan.c_str());
source.Reply(_("The channel \002%s\002 has no key."), chan.c_str());
return MOD_CONT;
}
bool override = !check_access(u, ci, CA_GETKEY);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci);
source.Reply(CHAN_GETKEY_KEY, chan.c_str(), key.c_str());
source.Reply(_("Key for channel \002%s\002 is \002%s\002."), chan.c_str(), key.c_str());
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_GETKEY);
source.Reply(_("Syntax: \002GETKEY \037channel\037\002\n"
" \n"
"Returns the key of the given channel."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "GETKEY", CHAN_GETKEY_SYNTAX);
SyntaxError(source, "GETKEY", _("GETKEY \037channel\037"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_GETKEY);
source.Reply(_(" GETKEY Returns the key of the given channel"));
}
};
+14 -3
View File
@@ -32,14 +32,25 @@ class CommandCSHelp : public Command
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
User *u = source.u;
source.Reply(CHAN_HELP);
source.Reply(_("\002%S\002 allows you to register and control various\n"
"aspects of channels. %S can often prevent\n"
"malicious users from \"taking over\" channels by limiting\n"
"who is allowed channel operator privileges. Available\n"
"commands are listed below; to use them, type\n"
"\002%R%S \037command\037\002. For more information on a\n"
"specific command, type \002%R%S HELP \037command\037\002."));
for (CommandMap::const_iterator it = ChanServ->Commands.begin(); it != ChanServ->Commands.end(); ++it)
if (!Config->HidePrivilegedCommands || it->second->permission.empty() || (u->Account() && u->Account()->HasCommand(it->second->permission)))
it->second->OnServHelp(source);
if (Config->CSExpire >= 86400)
source.Reply(CHAN_HELP_EXPIRES, Config->CSExpire / 86400);
source.Reply(_("Note that any channel which is not used for %d days\n"
"(i.e. which no user on the channel's access list enters\n"
"for that period of time) will be automatically dropped."), Config->CSExpire / 86400);
if (u->Account() && u->Account()->IsServicesOper())
source.Reply(CHAN_SERVADMIN_HELP);
source.Reply(_(" \n"
"Services Operators can also drop any channel without needing\n"
"to identify via password, and may view the access, AKICK,\n"
"and level setting lists for any channel."));
}
};
+38 -33
View File
@@ -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"));
}
};
+14 -9
View File
@@ -30,7 +30,7 @@ class CommandCSInvite : public Command
if (!(c = findchan(chan)))
{
source.Reply(CHAN_X_NOT_IN_USE, chan.c_str());
source.Reply(LanguageString::CHAN_X_NOT_IN_USE, chan.c_str());
return MOD_CONT;
}
@@ -38,7 +38,7 @@ class CommandCSInvite : public Command
if (!check_access(u, ci, CA_INVITE))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
@@ -49,7 +49,7 @@ class CommandCSInvite : public Command
{
if (!(u2 = finduser(params[1])))
{
source.Reply(NICK_X_NOT_IN_USE, params[1].c_str());
source.Reply(LanguageString::NICK_X_NOT_IN_USE, params[1].c_str());
return MOD_CONT;
}
}
@@ -58,30 +58,35 @@ class CommandCSInvite : public Command
Log(LOG_COMMAND, u, this, ci) << "for " << u2->nick;
if (c->FindUser(u2))
source.Reply(CHAN_INVITE_ALREADY_IN, c->name.c_str());
source.Reply(_("You are already in \002%s\002! "), c->name.c_str());
else
{
ircdproto->SendInvite(whosends(ci), chan, u2->nick);
source.Reply(CHAN_INVITE_OTHER_SUCCESS, u2->nick.c_str(), c->name.c_str());
u2->SendMessage(whosends(ci), CHAN_INVITE_SUCCESS, c->name.c_str());
source.Reply(_("\002%s\002 has been invited to \002%s\002."), u2->nick.c_str(), c->name.c_str());
u2->SendMessage(whosends(ci), _("You have been invited to \002%s\002."), c->name.c_str());
}
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_INVITE);
source.Reply(_("Syntax: \002INVITE \037channel\037\002\n"
" \n"
"Tells %S to invite you into the given channel.\n"
" \n"
"By default, limited to AOPs or those with level 5 and above\n"
"on the channel."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "INVITE", CHAN_INVITE_SYNTAX);
SyntaxError(source, "INVITE", _("INVITE \037channel\037"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_INVITE);
source.Reply(_(" INVITE Tells ChanServ to invite you into a channel"));
}
};
+14 -9
View File
@@ -36,17 +36,17 @@ class CommandCSKick : public Command
uint16 u_level = u_access ? u_access->level : 0, u2_level = u2_access ? u2_access->level : 0;
if (!c)
source.Reply(CHAN_X_NOT_IN_USE, chan.c_str());
source.Reply(LanguageString::CHAN_X_NOT_IN_USE, chan.c_str());
else if (!u2)
source.Reply(NICK_X_NOT_IN_USE, target.c_str());
source.Reply(LanguageString::NICK_X_NOT_IN_USE, target.c_str());
else if (!is_same ? !check_access(u, ci, CA_KICK) : !check_access(u, ci, CA_KICKME))
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
else if (!is_same && (ci->HasFlag(CI_PEACE)) && u2_level >= u_level)
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
else if (u2->IsProtected())
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
else if (!c->FindUser(u2))
source.Reply(NICK_X_NOT_ON_CHAN, u2->nick.c_str(), c->name.c_str());
source.Reply(LanguageString::NICK_X_NOT_ON_CHAN, u2->nick.c_str(), c->name.c_str());
else
{
// XXX
@@ -62,18 +62,23 @@ class CommandCSKick : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_KICK);
source.Reply(_("Syntax: \002KICK \037#channel\037 \037nick\037 [\037reason\037]\002\n"
" \n"
"Kicks a selected nick on a channel.\n"
" \n"
"By default, limited to AOPs or those with level 5 access \n"
"and above on the channel."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "KICK", CHAN_KICK_SYNTAX);
SyntaxError(source, "KICK", _("KICK \037#channel\037 \037nick\037 [\037reason\037]"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_KICK);
source.Reply(_(" KICK Kicks a selected nick from a channel"));
}
};
+19 -24
View File
@@ -35,37 +35,27 @@ public:
if (Config->CSListOpersOnly && !u->HasMode(UMODE_OPER))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_STOP;
}
if (pattern[0] == '#')
{
Anope::string tmp = myStrGetToken(pattern.substr(1), '-', 0); /* Read FROM out */
if (tmp.empty())
if (tmp.empty() || !tmp.is_number_only())
{
source.Reply(LIST_INCORRECT_RANGE);
source.Reply(CS_LIST_INCORRECT_RANGE);
return MOD_CONT;
}
if (!tmp.is_number_only())
{
source.Reply(LIST_INCORRECT_RANGE);
source.Reply(CS_LIST_INCORRECT_RANGE);
source.Reply(LanguageString::LIST_INCORRECT_RANGE);
source.Reply(_("To search for channels starting with #, search for the channel\n"
"name without the #-sign prepended (\002anope\002 instead of \002#anope\002)."));
return MOD_CONT;
}
from = convertTo<int>(tmp);
tmp = myStrGetTokenRemainder(pattern, '-', 1); /* Read TO out */
if (tmp.empty())
if (tmp.empty() || !tmp.is_number_only())
{
source.Reply(LIST_INCORRECT_RANGE);
source.Reply(CS_LIST_INCORRECT_RANGE);
return MOD_CONT;
}
if (!tmp.is_number_only())
{
source.Reply(LIST_INCORRECT_RANGE);
source.Reply(CS_LIST_INCORRECT_RANGE);
source.Reply(LanguageString::LIST_INCORRECT_RANGE);
source.Reply(_("To search for channels starting with #, search for the channel\n"
"name without the #-sign prepended (\002anope\002 instead of \002#anope\002)."));
return MOD_CONT;
}
to = convertTo<int>(tmp);
@@ -91,7 +81,7 @@ public:
Anope::string spattern = "#" + pattern;
source.Reply(NICK_LIST_HEADER, pattern.c_str());
source.Reply(LanguageString::LIST_HEADER, pattern.c_str());
for (registered_channel_map::const_iterator it = RegisteredChannelList.begin(), it_end = RegisteredChannelList.end(); it != it_end; ++it)
{
@@ -127,24 +117,29 @@ public:
}
}
source.Reply(CHAN_LIST_END, nchans > Config->CSListMax ? Config->CSListMax : nchans, nchans);
source.Reply(_("End of list - %d/%d matches shown."), nchans > Config->CSListMax ? Config->CSListMax : nchans, nchans);
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_LIST);
source.Reply(_("Syntax: \002LIST \037pattern\037\002\n"
" \n"
"Lists all registered channels matching the given pattern.\n"
"(Channels with the \002PRIVATE\002 option set are not listed.)\n"
"Note that a preceding '#' specifies a range, channel names\n"
"are to be written without '#'."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "LIST", NICK_LIST_SYNTAX);
SyntaxError(source, "LIST", LanguageString::NICK_LIST_SYNTAX);
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_LIST);
source.Reply(_(" LIST Lists all registered channels matching the given pattern"));
}
};
+33 -15
View File
@@ -46,18 +46,18 @@ class CommandCSMode : public Command
ChannelMode *cm = ModeManager::FindChannelModeByChar(modes[i]);
if (!cm || !cm->CanSet(u))
{
source.Reply(CHAN_MODE_LOCK_UNKNOWN, modes[i]);
source.Reply(_("Unknown mode character %c ignored."), modes[i]);
break;
}
Anope::string mode_param;
if (((cm->Type == MODE_STATUS || cm->Type == MODE_LIST) && !sep.GetToken(mode_param)) || (cm->Type == MODE_PARAM && adding && !sep.GetToken(mode_param)))
source.Reply(CHAN_MODE_LOCK_MISSING_PARAM, cm->ModeChar);
source.Reply(_("Missing parameter for mode %c."), cm->ModeChar);
else
{
ci->SetMLock(cm, adding, mode_param, u->nick);
if (!mode_param.empty())
mode_param = " " + mode_param;
source.Reply(CHAN_MODE_LOCKED, adding ? '+' : '-', cm->ModeChar, mode_param.c_str(), ci->name.c_str());
source.Reply(_("%c%c%s locked on %s"), adding ? '+' : '-', cm->ModeChar, mode_param.c_str(), ci->name.c_str());
}
}
}
@@ -89,22 +89,22 @@ class CommandCSMode : public Command
ChannelMode *cm = ModeManager::FindChannelModeByChar(modes[i]);
if (!cm || !cm->CanSet(u))
{
source.Reply(CHAN_MODE_LOCK_UNKNOWN, modes[i]);
source.Reply(_("Unknown mode character %c ignored."), modes[i]);
break;
}
Anope::string mode_param;
if (!cm->Type == MODE_REGULAR && !sep.GetToken(mode_param))
source.Reply(CHAN_MODE_LOCK_MISSING_PARAM, cm->ModeChar);
source.Reply(_("Missing parameter for mode %c."), cm->ModeChar);
else
{
if (ci->RemoveMLock(cm, mode_param))
{
if (!mode_param.empty())
mode_param = " " + mode_param;
source.Reply(CHAN_MODE_UNLOCKED, adding == 1 ? '+' : '-', cm->ModeChar, mode_param.c_str(), ci->name.c_str());
source.Reply(_("%c%c%s has been unlocked from %s."), adding == 1 ? '+' : '-', cm->ModeChar, mode_param.c_str(), ci->name.c_str());
}
else
source.Reply(CHAN_MODE_NOT_LOCKED, cm->ModeChar, ci->name.c_str());
source.Reply(_("%c is not locked on %s."), cm->ModeChar, ci->name.c_str());
}
}
}
@@ -114,11 +114,11 @@ class CommandCSMode : public Command
const std::multimap<ChannelModeName, ModeLock> &mlocks = ci->GetMLock();
if (mlocks.empty())
{
source.Reply(CHAN_MODE_LOCK_NONE, ci->name.c_str());
source.Reply(_("Channel %s has no mode locks."), ci->name.c_str());
}
else
{
source.Reply(CHAN_MODE_LOCK_HEADER, ci->name.c_str());
source.Reply(_("Mode locks for %s:"), ci->name.c_str());
for (std::multimap<ChannelModeName, ModeLock>::const_iterator it = mlocks.begin(), it_end = mlocks.end(); it != it_end; ++it)
{
const ModeLock &ml = it->second;
@@ -132,7 +132,7 @@ class CommandCSMode : public Command
Anope::string setter = ml.setter;
if (setter.empty())
setter = ci->founder ? ci->founder->display : "Unknown";
source.Reply(CHAN_MODE_LIST_FMT, ml.set ? '+' : '-', cm->ModeChar, modeparam.c_str(), setter.c_str(), do_strftime(ml.created).c_str());
source.Reply(_("%c%c%s, by %s on %s"), ml.set ? '+' : '-', cm->ModeChar, modeparam.c_str(), setter.c_str(), do_strftime(ml.created).c_str());
}
}
}
@@ -265,9 +265,9 @@ class CommandCSMode : public Command
ChannelInfo *ci = source.ci;
if (!ci || !ci->c)
source.Reply(CHAN_X_NOT_IN_USE, ci->name.c_str());
source.Reply(LanguageString::CHAN_X_NOT_IN_USE, ci->name.c_str());
else if (!check_access(u, ci, CA_MODE) && !u->Account()->HasCommand("chanserv/mode"))
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
else if (subcommand.equals_ci("LOCK"))
this->DoLock(source, params);
else if (subcommand.equals_ci("SET"))
@@ -280,18 +280,36 @@ class CommandCSMode : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_MODE);
source.Reply(_("Syntax: \002MODE \037channel\037 LOCK {ADD|DEL|LIST} [\037what\037]\002\n"
" \002MODE \037channel\037 SET \037modes\037\002\n"
" \n"
"Mainly controls mode locks and mode access (which is different from channel access)\n"
"on a channel.\n"
" \n"
"The \002MODE LOCK\002 command allows you to add, delete, and view mode locks on a channel.\n"
"If a mode is locked on or off, services will not allow that mode to be changed.\n"
"Example:\n"
" \002MODE #channel LOCK ADD +bmnt *!*@*aol*\002\n"
" \n"
"The \002MODE SET\002 command allows you to set modes through services. Wildcards * and ? may\n"
"be given as parameters for list and status modes.\n"
"Example:\n"
" \002MODE #channel SET +v *\002\n"
" Sets voice status to all users in the channel.\n"
" \n"
" \002MODE #channel SET -b ~c:*\n"
" Clears all extended bans that start with ~c:"));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "MODE", CHAN_MODE_SYNTAX);
SyntaxError(source, "MODE", _("MODE \037channel\037 {LOCK|SET} [\037modes\037 | {ADD|DEL|LIST} [\037what\037]]"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_MODE);
source.Reply(_(" MODE Control modes and mode locks on a channel"));
}
};
+107 -37
View File
@@ -54,19 +54,19 @@ class CommandModeBase : public Command
uint16 u_level = u_access ? u_access->level : 0, u2_level = u2_access ? u2_access->level : 0;
if (!c)
source.Reply(CHAN_X_NOT_IN_USE, chan.c_str());
source.Reply(LanguageString::CHAN_X_NOT_IN_USE, chan.c_str());
else if (!ci)
source.Reply(CHAN_X_NOT_REGISTERED, chan.c_str());
source.Reply(LanguageString::CHAN_X_NOT_REGISTERED, chan.c_str());
else if (!u2)
source.Reply(NICK_X_NOT_IN_USE, nick.c_str());
source.Reply(LanguageString::NICK_X_NOT_IN_USE, nick.c_str());
else if (is_same ? !check_access(u, ci, levelself) : !check_access(u, ci, level))
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
else if (!set && !is_same && ci->HasFlag(CI_PEACE) && u2_level >= u_level)
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
else if (!set && u2->IsProtected() && !is_same)
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
else if (!c->FindUser(u2))
source.Reply(NICK_X_NOT_ON_CHAN, u2->nick.c_str(), c->name.c_str());
source.Reply(LanguageString::NICK_X_NOT_ON_CHAN, u2->nick.c_str(), c->name.c_str());
else
{
if (set)
@@ -101,18 +101,25 @@ class CommandCSOp : public CommandModeBase
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_OP);
source.Reply(_("Syntax: \002OP [\037#channel\037] [\037nick\037]\002\n"
" \n"
"Ops a selected nick on a channel. If nick is not given,\n"
"it will op you. If channel is not given, it will op you\n"
"on every channel.\n"
" \n"
"By default, limited to AOPs or those with level 5 access \n"
"and above on the channel."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "OP", CHAN_OP_SYNTAX);
SyntaxError(source, "OP", _("OP [\037#channel\037] [\037nick\037]\002"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_OP);
source.Reply(_(" OP Gives Op status to a selected nick on a channel"));
}
};
@@ -132,18 +139,25 @@ class CommandCSDeOp : public CommandModeBase
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_DEOP);
source.Reply(_("Syntax: \002DEOP [\037#channel\037] [\037nick\037]\002\n"
" \n"
"Deops a selected nick on a channel. If nick is not given,\n"
"it will deop you. If channel is not given, it will deop\n"
"you on every channel.\n"
" \n"
"By default, limited to AOPs or those with level 5 access \n"
"and above on the channel."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "DEOP", CHAN_DEOP_SYNTAX);
SyntaxError(source, "DEOP", _("DEOP [\037#channel\037] [\037nick\037]\002"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_DEOP);
source.Reply(_(" DEOP Deops a selected nick on a channel"));
}
};
@@ -163,18 +177,26 @@ class CommandCSVoice : public CommandModeBase
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_VOICE);
source.Reply(_("Syntax: \002VOICE [\037#channel\037] [\037nick\037]\002\n"
" \n"
"Voices a selected nick on a channel. If nick is not given,\n"
"it will voice you. If channel is not given, it will voice you\n"
"on every channel.\n"
" \n"
"By default, limited to AOPs or those with level 5 access \n"
"and above on the channel, or to VOPs or those with level 3 \n"
"and above for self voicing."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "VOICE", CHAN_VOICE_SYNTAX);
SyntaxError(source, "VOICE", _("VOICE [\037#channel\037] [\037nick\037]\002"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_VOICE);
source.Reply(_(" VOICE Voices a selected nick on a channel"));
}
};
@@ -194,18 +216,26 @@ class CommandCSDeVoice : public CommandModeBase
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_DEVOICE);
source.Reply(_("Syntax: \002DEVOICE [\037#channel\037] [\037nick\037]\002\n"
" \n"
"Devoices a selected nick on a channel. If nick is not given,\n"
"it will devoice you. If channel is not given, it will devoice\n"
"you on every channel.\n"
" \n"
"By default, limited to AOPs or those with level 5 access \n"
"and above on the channel, or to VOPs or those with level 3 \n"
"and above for self devoicing."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "DEVOICE", CHAN_DEVOICE_SYNTAX);
SyntaxError(source, "DEVOICE", _("DEVOICE [\037#channel\037] [\037nick\037]\002"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_DEVOICE);
source.Reply(_(" DEVOICE Devoices a selected nick on a channel"));
}
};
@@ -228,18 +258,25 @@ class CommandCSHalfOp : public CommandModeBase
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_HALFOP);
source.Reply(_("Syntax: \002HALFOP [\037#channel\037] [\037nick\037]\002\n"
" \n"
"Halfops a selected nick on a channel. If nick is not given,\n"
"it will halfop you. If channel is not given, it will halfop\n"
"you on every channel.\n"
" \n"
"By default, limited to AOPs and those with level 5 access \n"
"and above on the channel, or to HOPs or those with level 4 \n"));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "HALFOP", CHAN_HALFOP_SYNTAX);
SyntaxError(source, "HALFOP", _("HALFOP [\037#channel\037] [\037nick\037]\002"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_HALFOP);
source.Reply(_(" HALFOP Halfops a selected nick on a channel"));
}
};
@@ -262,18 +299,26 @@ class CommandCSDeHalfOp : public CommandModeBase
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_DEHALFOP);
source.Reply(_("Syntax: \002DEHALFOP [\037#channel\037] [\037nick\037]\002\n"
" \n"
"Dehalfops a selected nick on a channel. If nick is not given,\n"
"it will dehalfop you. If channel is not given, it will dehalfop\n"
"you on every channel.\n"
" \n"
"By default, limited to AOPs and those with level 5 access \n"
"and above on the channel, or to HOPs or those with level 4 \n"
"and above for self dehalfopping."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "DEHALFOP", CHAN_DEHALFOP_SYNTAX);
SyntaxError(source, "DEHALFOP", _("DEHALFOP [\037#channel\037] [\037nick\037]\002"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_DEHALFOP);
source.Reply(_(" DEHALFOP Dehalfops a selected nick on a channel"));
}
};
@@ -296,18 +341,25 @@ class CommandCSProtect : public CommandModeBase
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_PROTECT);
source.Reply(_("Syntax: \002PROTECT [\037#channel\037] [\037nick\037]\002\n"
" \n"
"Protects a selected nick on a channel. If nick is not given,\n"
"it will protect you. If channel is not given, it will protect\n"
"you on every channel.\n"
" \n"
"By default, limited to the founder, or to SOPs or those with \n"
"level 10 and above on the channel for self protecting."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "PROTECT", CHAN_PROTECT_SYNTAX);
SyntaxError(source, "PROTECT", _("PROTECT [\037#channel\037] [\037nick\037]\002"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_PROTECT);
source.Reply(_(" PROTECT Protects a selected nick on a channel"));
}
};
@@ -330,18 +382,24 @@ class CommandCSDeProtect : public CommandModeBase
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_DEPROTECT);
source.Reply(_("Syntax: \002DEPROTECT [\037#channel\037] [\037nick\037]\002\n"
" \n"
"Deprotects a selected nick on a channel. If nick is not given,\n"
"it will deprotect you. If channel is not given, it will deprotect\n"
"you on every channel.\n"
" \n"
"By default, limited to the founder, or to SOPs or those with \n"));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "DEPROTECT", CHAN_DEPROTECT_SYNTAX);
SyntaxError(source, "DEPROTECT", _("DEROTECT [\037#channel\037] [\037nick\037]\002"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_DEPROTECT);
source.Reply(_(" DEPROTECT Deprotects a selected nick on a channel"));
}
};
@@ -364,18 +422,24 @@ class CommandCSOwner : public CommandModeBase
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_OWNER);
source.Reply(_("Syntax: \002OWNER [\037#channel\037] [\037nick\037]\002\n"
" \n"
"Gives the selected nick owner status on \002channel\002. If nick is not\n"
"given, it will give you owner. If channel is not given, it will\n"
"give you owner on every channel.\n"
" \n"
"Limited to those with founder access on the channel."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "OWNER", CHAN_OWNER_SYNTAX);
SyntaxError(source, "OWNER", _("OWNER [\037#channel\037] [\037nick\037]\002"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_OWNER);
source.Reply(_(" OWNER Gives you owner status on channel"));
}
};
@@ -398,18 +462,24 @@ class CommandCSDeOwner : public CommandModeBase
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_DEOWNER);
source.Reply(_("Syntax: \002DEOWNER [\037#channel\037] [\037nick\037]\002\n"
" \n"
"Removes owner status from the selected nick on \002channel\002. If nick\n"
"is not given, it will deowner you. If channel is not given, it will\n"
"deowner you on every channel.\n"
" \n"
"Limited to those with founder access on the channel."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "DEOWNER", CHAN_DEOWNER_SYNTAX);
SyntaxError(source, "DEOWNER", _("DEOWNER [\037#channel\037] [\037nick\037]\002"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_DEOWNER);
source.Reply(_(" DEOWNER Removes your owner status on a channel"));
}
};
+30 -11
View File
@@ -32,22 +32,22 @@ class CommandCSRegister : public Command
if (readonly)
{
source.Reply(CHAN_REGISTER_DISABLED);
source.Reply(_("Sorry, channel registration is temporarily disabled."));
return MOD_CONT;
}
if (chan[0] == '&')
source.Reply(CHAN_REGISTER_NOT_LOCAL);
source.Reply(_("Local channels cannot be registered."));
else if (chan[0] != '#')
source.Reply(CHAN_SYMBOL_REQUIRED);
source.Reply(LanguageString::CHAN_SYMBOL_REQUIRED);
else if (!ircdproto->IsChannelValid(chan))
source.Reply(CHAN_X_INVALID, chan.c_str());
source.Reply(LanguageString::CHAN_X_INVALID, chan.c_str());
else if (ci)
source.Reply(CHAN_ALREADY_REGISTERED, chan.c_str());
source.Reply(_("Channel \002%s\002 is already registered!"), chan.c_str());
else if (c && !c->HasUserStatus(u, CMODE_OP))
source.Reply(CHAN_MUST_BE_CHANOP);
source.Reply(_("You must be a channel operator to register the channel."));
else if (Config->CSMaxReg && u->Account()->channelcount >= Config->CSMaxReg && !u->Account()->HasPriv("chanserv/no-register-limit"))
source.Reply(u->Account()->channelcount > Config->CSMaxReg ? CHAN_EXCEEDED_CHANNEL_LIMIT : CHAN_REACHED_CHANNEL_LIMIT, Config->CSMaxReg);
source.Reply(u->Account()->channelcount > Config->CSMaxReg ? LanguageString::CHAN_EXCEEDED_CHANNEL_LIMIT : LanguageString::CHAN_REACHED_CHANNEL_LIMIT, Config->CSMaxReg);
else
{
ci = new ChannelInfo(chan);
@@ -66,7 +66,7 @@ class CommandCSRegister : public Command
ci->bi = NULL;
++ci->founder->channelcount;
Log(LOG_COMMAND, u, this, ci);
source.Reply(CHAN_REGISTERED, chan.c_str(), u->nick.c_str());
source.Reply(_("Channel \002%s\002 registered under your nickname: %s"), chan.c_str(), u->nick.c_str());
/* Implement new mode lock */
if (c)
@@ -98,18 +98,37 @@ class CommandCSRegister : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_REGISTER, Config->s_ChanServ.c_str());
source.Reply(_("Syntax: \002REGISTER \037channel\037 \037description\037\002\n"
" \n"
"Registers a channel in the %S database. In order\n"
"to use this command, you must first be a channel operator\n"
"on the channel you're trying to register.\n"
"The description, which \002must\002 be included, is a\n"
"general description of the channel's purpose.\n"
" \n"
"When you register a channel, you are recorded as the\n"
"\"founder\" of the channel. The channel founder is allowed\n"
"to change all of the channel settings for the channel;\n"
"%S will also automatically give the founder\n"
"channel-operator privileges when s/he enters the channel.\n"
"See the \002ACCESS\002 command (\002%R%S HELP ACCESS\002) for\n"
"information on giving a subset of these privileges to\n"
"other channel users.\n"
" \n"
"NOTICE: In order to register a channel, you must have\n"
"first registered your nickname. If you haven't,\n"
"\002%R%s HELP\002 for information on how to do so."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "REGISTER", CHAN_REGISTER_SYNTAX);
SyntaxError(source, "REGISTER", _("REGISTER \037channel\037 \037description\037"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_REGISTER);
source.Reply(_(" REGISTER Register a channel"));
}
};
+14 -8
View File
@@ -34,14 +34,14 @@ class CommandCSSASet : public Command
if (readonly)
{
source.Reply(CHAN_SET_DISABLED);
source.Reply(LanguageString::CHAN_SET_DISABLED);
return MOD_CONT;
}
// XXX Remove after 1.9.4 release
if (params[1].equals_ci("MLOCK"))
{
source.Reply(CHAN_SET_MLOCK_DEPRECATED);
source.Reply(LanguageString::CHAN_SET_MLOCK_DEPRECATED);
return MOD_CONT;
}
@@ -58,8 +58,8 @@ class CommandCSSASet : public Command
}
else
{
source.Reply(NICK_SET_UNKNOWN_OPTION, params[1].c_str());
source.Reply(MORE_INFO, Config->s_ChanServ.c_str(), "SET");
source.Reply(_("Unknown SASET option \002%s\002."), params[1].c_str());
source.Reply(LanguageString::MORE_INFO, Config->s_ChanServ.c_str(), "SET");
}
return MOD_CONT;
@@ -69,10 +69,16 @@ class CommandCSSASet : public Command
{
if (subcommand.empty())
{
source.Reply(CHAN_HELP_SASET_HEAD);
source.Reply(_("Syntax: SASET \002channel\002 \037option\037 \037parameters\037\n"
" \n"
"Allows Services Operators to forcefully change settings\n"
"on channels.\n"
" \n"
"Available options:"));
for (subcommand_map::iterator it = this->subcommands.begin(), it_end = this->subcommands.end(); it != it_end; ++it)
it->second->OnServHelp(source);
source.Reply(CHAN_HELP_SASET_TAIL);
source.Reply(_("Type \002%R%S HELP SASET \037option\037\002 for more information on a\n"
"particular option."));
return true;
}
else
@@ -88,12 +94,12 @@ class CommandCSSASet : public Command
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "SASET", CHAN_SASET_SYNTAX);
SyntaxError(source, "SASET", LanguageString::CHAN_SASET_SYNTAX);
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_SASET);
source.Reply(_(" SASET Forcefully set channel options and information"));
}
bool AddSubcommand(Module *creator, Command *c)
+8 -5
View File
@@ -29,12 +29,12 @@ class CommandCSSASetNoexpire : public Command
if (params[1].equals_ci("ON"))
{
ci->SetFlag(CI_NO_EXPIRE);
source.Reply(CHAN_SET_NOEXPIRE_ON, ci->name.c_str());
source.Reply(_("Channel %s \002will not\002 expire."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_NO_EXPIRE);
source.Reply(CHAN_SET_NOEXPIRE_OFF, ci->name.c_str());
source.Reply(_("Channel %s \002will\002 expire."), ci->name.c_str());
}
else
this->OnSyntaxError(source, "NOEXPIRE");
@@ -44,18 +44,21 @@ class CommandCSSASetNoexpire : public Command
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_SERVADMIN_HELP_SET_NOEXPIRE);
source.Reply(_("Syntax: \002SET \037channel\037 NOEXPIRE {ON | OFF}\002\n"
" \n"
"Sets whether the given channel will expire. Setting this\n"
"to ON prevents the channel from expiring."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SET NOEXPIRE", CHAN_SET_NOEXPIRE_SYNTAX);
SyntaxError(source, "SET NOEXPIRE", _("SET \037channel\037 NOEXPIRE {ON | OFF}"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_SET_NOEXPIRE);
source.Reply(_(" NOEXPIRE Prevent the channel from expiring"));
}
};
+15 -9
View File
@@ -34,19 +34,19 @@ class CommandCSSet : public Command
if (readonly)
{
source.Reply(CHAN_SET_DISABLED);
source.Reply(LanguageString::CHAN_SET_DISABLED);
return MOD_CONT;
}
if (!check_access(u, cs_findchan(params[0]), CA_SET))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
// XXX Remove after 1.9.4 release
if (params[1].equals_ci("MLOCK"))
{
source.Reply(CHAN_SET_MLOCK_DEPRECATED, Config->s_ChanServ.c_str());
source.Reply(LanguageString::CHAN_SET_MLOCK_DEPRECATED, Config->s_ChanServ.c_str());
return MOD_CONT;
}
@@ -62,8 +62,8 @@ class CommandCSSet : public Command
}
else
{
source.Reply(NICK_SET_UNKNOWN_OPTION, params[1].c_str());
source.Reply(MORE_INFO, Config->s_ChanServ.c_str(), "SET");
source.Reply(LanguageString::NICK_SET_UNKNOWN_OPTION, params[1].c_str());
source.Reply(LanguageString::MORE_INFO, Config->s_ChanServ.c_str(), "SET");
}
return MOD_CONT;
@@ -73,10 +73,16 @@ class CommandCSSet : public Command
{
if (subcommand.empty())
{
source.Reply(CHAN_HELP_SET_HEAD);
source.Reply(_("Syntax: \002SET \037channel\037 \037option\037 \037parameters\037\002\n"
" \n"
"Allows the channel founder to set various channel options\n"
"and other information.\n"
" \n"
"Available options:"));
for (subcommand_map::iterator it = this->subcommands.begin(), it_end = this->subcommands.end(); it != it_end; ++it)
it->second->OnServHelp(source);
source.Reply(CHAN_HELP_SET_TAIL);
source.Reply(_("Type \002%R%S HELP SET \037option\037\002 for more information on a\n"
"particular option."));
return true;
}
else
@@ -92,12 +98,12 @@ class CommandCSSet : public Command
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "SET", CHAN_SET_SYNTAX);
SyntaxError(source, "SET", LanguageString::CHAN_SET_SYNTAX);
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_SET);
source.Reply(_(" SET Set channel options and information"));
}
bool AddSubcommand(Module *creator, Command *c)
+16 -12
View File
@@ -31,11 +31,11 @@ class CommandCSSetBanType : public Command
int16 bantype = convertTo<int16>(params[1], end, false);
if (!end.empty() || bantype < 0 || bantype > 3)
source.Reply(CHAN_SET_BANTYPE_INVALID, params[1].c_str());
source.Reply(_("\002%s\002 is not a valid ban type."), params[1].c_str());
else
{
ci->bantype = bantype;
source.Reply(CHAN_SET_BANTYPE_CHANGED, ci->name.c_str(), ci->bantype);
source.Reply(_("Ban type for channel %s is now #%d."), ci->name.c_str(), ci->bantype);
}
return MOD_CONT;
@@ -43,19 +43,29 @@ class CommandCSSetBanType : public Command
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_BANTYPE, "SET");
source.Reply(_("Syntax: \002%s \037channel\037 BANTYPE \037bantype\037\002\n"
" \n"
"Sets the ban type that will be used by services whenever\n"
"they need to ban someone from your channel.\n"
" \n"
"bantype is a number between 0 and 3 that means:\n"
" \n"
"0: ban in the form *!user@host\n"
"1: ban in the form *!*user@host\n"
"2: ban in the form *!*@host\n"
"3: ban in the form *!*user@*.domain"), this->name.c_str());
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
// XXX
SyntaxError(source, "SET", CHAN_SET_SYNTAX);
SyntaxError(source, "SET", LanguageString::CHAN_SET_SYNTAX);
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_SET_BANTYPE);
source.Reply(_(" BANTYPE Set how Services make bans on the channel"));
}
};
@@ -66,16 +76,10 @@ class CommandCSSASetBanType : public CommandCSSetBanType
{
}
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_BANTYPE, "SASET");
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
// XXX
SyntaxError(source, "SASET", CHAN_SASET_SYNTAX);
SyntaxError(source, "SASET", LanguageString::CHAN_SASET_SYNTAX);
}
};
+8 -11
View File
@@ -28,26 +28,29 @@ class CommandCSSetDescription : public Command
ci->desc = params[1];
source.Reply(CHAN_DESC_CHANGED, ci->name.c_str(), ci->desc.c_str());
source.Reply(_("Description of %s changed to \002%s\002."), ci->name.c_str(), ci->desc.c_str());
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_DESC, "SET");
source.Reply(_("Syntax: \002%s \037channel\037 DESC \037description\037\002\n"
" \n"
"Sets the description for the channel, which shows up with\n"
"the \002LIST\002 and \002INFO\002 commands."), this->name.c_str());
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
// XXX
SyntaxError(source, "SET", CHAN_SET_SYNTAX);
SyntaxError(source, "SET", LanguageString::CHAN_SET_SYNTAX);
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_SET_DESC);
source.Reply(_(" DESC Set the channel description"));
}
};
@@ -58,16 +61,10 @@ class CommandCSSASetDescription : public CommandCSSetDescription
{
}
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_DESC, "SASET");
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
// XXX
SyntaxError(source, "SASET", CHAN_SASET_SYNTAX);
SyntaxError(source, "SASET", LanguageString::CHAN_SASET_SYNTAX);
}
};
+12 -15
View File
@@ -29,7 +29,7 @@ class CommandCSSetFounder : public Command
if (this->permission.empty() && (ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !check_access(u, ci, CA_FOUNDER)))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
@@ -38,19 +38,19 @@ class CommandCSSetFounder : public Command
if (!na)
{
source.Reply(NICK_X_NOT_REGISTERED, params[1].c_str());
source.Reply(LanguageString::NICK_X_NOT_REGISTERED, params[1].c_str());
return MOD_CONT;
}
else if (na->HasFlag(NS_FORBIDDEN))
{
source.Reply(NICK_X_FORBIDDEN, na->nick.c_str());
source.Reply(LanguageString::NICK_X_FORBIDDEN, na->nick.c_str());
return MOD_CONT;
}
nc = na->nc;
if (Config->CSMaxReg && nc->channelcount >= Config->CSMaxReg && !u->Account()->HasPriv("chanserv/no-register-limit"))
{
source.Reply(CHAN_SET_FOUNDER_TOO_MANY_CHANS, na->nick.c_str());
source.Reply(_("\002%s\002 has too many channels registered."), na->nick.c_str());
return MOD_CONT;
}
@@ -64,26 +64,29 @@ class CommandCSSetFounder : public Command
ci->founder = nc;
++nc->channelcount;
source.Reply(CHAN_FOUNDER_CHANGED, ci->name.c_str(), na->nick.c_str());
source.Reply(_("Founder of %s changed to \002%s\002."), ci->name.c_str(), na->nick.c_str());
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_FOUNDER, "SET");
source.Reply(_("Syntax: \002%s \037channel\037 FOUNDER \037nick\037\002\n"
" \n"
"Changes the founder of a channel. The new nickname must\n"
"be a registered one."), this->name.c_str());
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
// XXX
SyntaxError(source, "SET", CHAN_SET_SYNTAX);
SyntaxError(source, "SET", LanguageString::CHAN_SET_SYNTAX);
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_SET_FOUNDER);
source.Reply(_(" FOUNDER Set the founder of a channel"));
}
};
@@ -94,16 +97,10 @@ class CommandCSSASetFounder : public CommandCSSetFounder
{
}
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_FOUNDER, "SASET");
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
// XXX
SyntaxError(source, "SASET", CHAN_SASET_SYNTAX);
SyntaxError(source, "SASET", LanguageString::CHAN_SASET_SYNTAX);
}
};
+12 -12
View File
@@ -29,12 +29,12 @@ class CommandCSSetKeepTopic : public Command
if (params[1].equals_ci("ON"))
{
ci->SetFlag(CI_KEEPTOPIC);
source.Reply(CHAN_SET_KEEPTOPIC_ON, ci->name.c_str());
source.Reply(_("Topic retention option for %s is now \002\002."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_KEEPTOPIC);
source.Reply(CHAN_SET_KEEPTOPIC_OFF, ci->name.c_str());
source.Reply(_("Topic retention option for %s is now \002\002."), ci->name.c_str());
}
else
this->OnSyntaxError(source, "KEEPTOPIC");
@@ -44,18 +44,24 @@ class CommandCSSetKeepTopic : public Command
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_KEEPTOPIC, "SET");
source.Reply(_("Syntax: \002%s \037channel\037 KEEPTOPIC {ON | OFF}\002\n"
" \n"
"Enables or disables the \002topic retention\002 option for a \n"
"channel. When \002topic retention\002 is set, the topic for the\n"
"channel will be remembered by %S even after the\n"
"last user leaves the channel, and will be restored the\n"
"next time the channel is created."), this->name.c_str());
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SET KEEPTOPIC", CHAN_SET_KEEPTOPIC_SYNTAX);
SyntaxError(source, "SET KEEPTOPIC", _("SET \037channel\037 KEEPTOPIC {ON | OFF}"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_SET_KEEPTOPIC);
source.Reply(_(" KEEPTOPIC Retain topic when channel is not in use"));
}
};
@@ -66,15 +72,9 @@ class CommandCSSASetKeepTopic : public CommandCSSetKeepTopic
{
}
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_KEEPTOPIC, "SASET");
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SET KEEPTOPIC", CHAN_SASET_KEEPTOPIC_SYNTAX);
SyntaxError(source, "SET KEEPTOPIC", _("SASET \002channel\002 KEEPTOPIC {ON | OFF}"));
}
};
+11 -12
View File
@@ -29,12 +29,12 @@ class CommandCSSetOpNotice : public Command
if (params[1].equals_ci("ON"))
{
ci->SetFlag(CI_OPNOTICE);
source.Reply(CHAN_SET_OPNOTICE_ON, ci->name.c_str());
source.Reply(_("Op-notice option for %s is now \002\002."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_OPNOTICE);
source.Reply(CHAN_SET_OPNOTICE_OFF, ci->name.c_str());
source.Reply(_("Op-notice option for %s is now \002\002."), ci->name.c_str());
}
else
this->OnSyntaxError(source, "OPNOTICE");
@@ -44,18 +44,23 @@ class CommandCSSetOpNotice : public Command
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_OPNOTICE, "SET");
source.Reply(_("Syntax: \002%s \037channel\037 OPNOTICE {ON | OFF}\002\n"
" \n"
"Enables or disables the \002op-notice\002 option for a channel.\n"
"When \002op-notice\002 is set, %S will send a notice to the\n"
"channel whenever the \002OP\002 or \002DEOP\002 commands are used for a user\n"
"in the channel."), this->name.c_str());
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SET OPNOTICE", CHAN_SET_OPNOTICE_SYNTAX);
SyntaxError(source, "SET OPNOTICE", _("SET \037channel\037 OPNOTICE {ON | OFF}"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_SET_OPNOTICE);
source.Reply(_(" OPNOTICE Send a notice when OP/DEOP commands are used"));
}
};
@@ -66,15 +71,9 @@ class CommandCSSASetOpNotice : public CommandCSSetOpNotice
{
}
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_OPNOTICE, "SASET");
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SET OPNOTICE", CHAN_SASET_OPNOTICE_SYNTAX);
SyntaxError(source, "SET OPNOTICE", _("SASET \002channel\002 OPNOTICE {ON | OFF}"));
}
};
+11 -12
View File
@@ -29,12 +29,12 @@ class CommandCSSetPeace : public Command
if (params[1].equals_ci("ON"))
{
ci->SetFlag(CI_PEACE);
source.Reply(CHAN_SET_PEACE_ON, ci->name.c_str());
source.Reply(_("Peace option for %s is now \002\002."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_PEACE);
source.Reply(CHAN_SET_PEACE_OFF, ci->name.c_str());
source.Reply(_("Peace option for %s is now \002\002."), ci->name.c_str());
}
else
this->OnSyntaxError(source, "PEACE");
@@ -44,18 +44,23 @@ class CommandCSSetPeace : public Command
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_PEACE, "SET");
source.Reply(_("Syntax: \002%s \037channel\037 PEACE {ON | OFF}\002\n"
" \n"
"Enables or disables the \002peace\002 option for a channel.\n"
"When \002peace\002 is set, a user won't be able to kick,\n"
"ban or remove a channel status of a user that has\n"
"a level superior or equal to his via %S commands."), this->name.c_str());
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SET PEACE", CHAN_SET_PEACE_SYNTAX);
SyntaxError(source, "SET PEACE", _("SET \037channel\037 PEACE {ON | OFF}"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_SET_PEACE, "SET");
source.Reply(_(" PEACE Regulate the use of critical commands"), "SET");
}
};
@@ -66,15 +71,9 @@ class CommandCSSASetPeace : public CommandCSSetPeace
{
}
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_PEACE, "SASET");
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SASET PEACE", CHAN_SASET_PEACE_SYNTAX);
SyntaxError(source, "SASET PEACE", _("SASET \002channel\002 PEACE {ON | OFF}"));
}
};
+25 -12
View File
@@ -65,7 +65,7 @@ class CommandCSSetPersist : public Command
}
}
source.Reply(CHAN_SET_PERSIST_ON, ci->name.c_str());
source.Reply(_("Channel \002%s\002 is now persistant."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
@@ -92,7 +92,7 @@ class CommandCSSetPersist : public Command
ChanServ->UnAssign(NULL, ci);
}
source.Reply(CHAN_SET_PERSIST_OFF, ci->name.c_str());
source.Reply(_("Channel \002%s\002 is no longer persistant."), ci->name.c_str());
}
else
this->OnSyntaxError(source, "PERSIST");
@@ -102,18 +102,37 @@ class CommandCSSetPersist : public Command
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_PERSIST, "SET");
source.Reply(_("Syntax: \002%s \037channel\037 PERSIST {ON | OFF}\002\n"
"Enables or disables the persistant channel setting.\n"
"When persistant is set, the service bot will remain\n"
"in the channel when it has emptied of users.\n"
" \n"
"If your IRCd does not a permanent (persistant) channel\n"
"mode you must have a service bot in your channel to\n"
"set persist on, and it can not be unassigned while persist\n"
"is on.\n"
" \n"
"If this network does not have BotServ enabled and does\n"
"not have a permanent channel mode, ChanServ will\n"
"join your channel when you set persist on (and leave when\n"
"it has been set off).\n"
" \n"
"If your IRCd has a permanent (persistant) channel mode\n"
"and is is set or unset (for any reason, including MLOCK),\n"
"persist is automatically set and unset for the channel aswell.\n"
"Additionally, services will set or unset this mode when you\n"
"set persist on or off."), this->name.c_str());
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SET PERSIST", CHAN_SET_PERSIST_SYNTAX);
SyntaxError(source, "SET PERSIST", _("SET \037channel\037 PERSIST {ON | OFF}"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_SET_PERSIST);
source.Reply(_(" PERSIST Set the channel as permanent"));
}
};
@@ -124,15 +143,9 @@ class CommandCSSASetPersist : public CommandCSSetPersist
{
}
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_PERSIST, "SASET");
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SASET PERSIST", CHAN_SASET_PERSIST_SYNTAX);
SyntaxError(source, "SASET PERSIST", _("SASET \002channel\002 PERSIST {ON | OFF}"));
}
};
+10 -12
View File
@@ -29,12 +29,12 @@ class CommandCSSetPrivate : public Command
if (params[1].equals_ci("ON"))
{
ci->SetFlag(CI_PRIVATE);
source.Reply(CHAN_SET_PRIVATE_ON, ci->name.c_str());
source.Reply(_("Private option for %s is now \002\002."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_PRIVATE);
source.Reply(CHAN_SET_PRIVATE_OFF, ci->name.c_str());
source.Reply(_("Private option for %s is now \002\002."), ci->name.c_str());
}
else
this->OnSyntaxError(source, "PRIVATE");
@@ -44,18 +44,22 @@ class CommandCSSetPrivate : public Command
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_PRIVATE, "SASET");
source.Reply(_("Syntax: \002%s \037channel\037 PRIVATE {ON | OFF}\002\n"
" \n"
"Enables or disables the \002private\002 option for a channel.\n"
"When \002private\002 is set, a \002%R%S LIST\002 will not\n"
"include the channel in any lists."), this->name.c_str());
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SET PRIVATE", CHAN_SET_PRIVATE_SYNTAX);
SyntaxError(source, "SET PRIVATE", _("SET \037channel\037 PRIVATE {ON | OFF}"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_SET_PRIVATE);
source.Reply(_(" PRIVATE Hide channel from LIST command"));
}
};
@@ -66,15 +70,9 @@ class CommandCSSASetPrivate : public CommandCSSetPrivate
{
}
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_PRIVATE, "SASET");
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SASET PRIVATE", CHAN_SASET_PRIVATE_SYNTAX);
SyntaxError(source, "SASET PRIVATE", _("SASET \002channel\002 PRIVATE {ON | OFF}"));
}
};
+10 -12
View File
@@ -30,14 +30,14 @@ class CommandCSSetRestricted : public Command
ci->SetFlag(CI_RESTRICTED);
if (ci->levels[CA_NOJOIN] < 0)
ci->levels[CA_NOJOIN] = 0;
source.Reply(CHAN_SET_RESTRICTED_ON, ci->name.c_str());
source.Reply(_("Restricted access option for %s is now \002\002."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_RESTRICTED);
if (ci->levels[CA_NOJOIN] >= 0)
ci->levels[CA_NOJOIN] = -2;
source.Reply(CHAN_SET_RESTRICTED_OFF, ci->name.c_str());
source.Reply(_("Restricted access option for %s is now \002\002."), ci->name.c_str());
}
else
this->OnSyntaxError(source, "RESTRICTED");
@@ -47,18 +47,22 @@ class CommandCSSetRestricted : public Command
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_RESTRICTED, "SET");
source.Reply(_("Syntax: \002%s \037channel\037 RESTRICTED {ON | OFF}\002\n"
" \n"
"Enables or disables the \002restricted access\002 option for a\n"
"channel. When \002restricted access\002 is set, users not on the access list will\n"
"instead be kicked and banned from the channel."), this->name.c_str());
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SET RESTRICTED", CHAN_SET_RESTRICTED_SYNTAX);
SyntaxError(source, "SET RESTRICTED", _("SET \037channel\037 RESTRICTED {ON | OFF}"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_SET_RESTRICTED);
source.Reply(_(" RESTRICTED Restrict access to the channel"));
}
};
@@ -69,15 +73,9 @@ class CommandCSSASetRestricted : public CommandCSSetRestricted
{
}
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_RESTRICTED, "SASET");
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SASET RESTRICTED", CHAN_SASET_RESTRICTED_SYNTAX);
SyntaxError(source, "SASET RESTRICTED", _("SASET \002channel\002 RESTRICTED {ON | OFF}"));
}
};
+12 -12
View File
@@ -29,12 +29,12 @@ class CommandCSSetSecure : public Command
if (params[1].equals_ci("ON"))
{
ci->SetFlag(CI_SECURE);
source.Reply(CHAN_SET_SECURE_ON, ci->name.c_str());
source.Reply(_("Secure option for %s is now \002\002."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_SECURE);
source.Reply(CHAN_SET_SECURE_OFF, ci->name.c_str());
source.Reply(_("Secure option for %s is now \002\002."), ci->name.c_str());
}
else
this->OnSyntaxError(source, "SECURE");
@@ -44,18 +44,24 @@ class CommandCSSetSecure : public Command
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_SECURE, "SET", Config->s_NickServ.c_str());
source.Reply(_("Syntax: \002%s \037channel\037 SECURE {ON | OFF}\002\n"
" \n"
"Enables or disables %S's security features for a\n"
"channel. When \002SECURE\002 is set, only users who have\n"
"registered their nicknames with %s and IDENTIFY'd\n"
"with their password will be given access to the channel\n"
"as controlled by the access list."), this->name.c_str(), Config->s_NickServ.c_str());
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SET SECURE", CHAN_SET_SECURE_SYNTAX);
SyntaxError(source, "SET SECURE", _("SET \037channel\037 SECURE {ON | OFF}"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_SET_SECURE);
source.Reply(_(" SECURE Activate %S security features"));
}
};
@@ -66,15 +72,9 @@ class CommandCSSASetSecure : public CommandCSSetSecure
{
}
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_SECURE, "SASET", Config->s_NickServ.c_str());
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SASET SECURE", CHAN_SASET_SECURE_SYNTAX);
SyntaxError(source, "SASET SECURE", _("SASET \002channel\002 SECURE {ON | OFF}"));
}
};
+13 -13
View File
@@ -29,19 +29,19 @@ class CommandCSSetSecureFounder : public Command
if (this->permission.empty() && ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !check_access(u, ci, CA_FOUNDER))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
if (params[1].equals_ci("ON"))
{
ci->SetFlag(CI_SECUREFOUNDER);
source.Reply(CHAN_SET_SECUREFOUNDER_ON, ci->name.c_str());
source.Reply(_("Secure founder option for %s is now \002\002."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_SECUREFOUNDER);
source.Reply(CHAN_SET_SECUREFOUNDER_OFF, ci->name.c_str());
source.Reply(_("Secure founder option for %s is now \002\002."), ci->name.c_str());
}
else
this->OnSyntaxError(source, "SECUREFOUNDER");
@@ -51,18 +51,24 @@ class CommandCSSetSecureFounder : public Command
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_SECUREFOUNDER, "SET");
source.Reply(_("Syntax: \002%s \037channel\037 SECUREFOUNDER {ON | OFF}\002\n"
" \n"
"Enables or disables the \002secure founder\002 option for a channel.\n"
"When \002secure founder\002 is set, only the real founder will be\n"
"able to drop the channel, change its password, its founder and its\n"
"successor, and not those who have founder level access through\n"
"the access/qop command."), this->name.c_str());
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SET SECUREFOUNDER", CHAN_SET_SECUREFOUNDER_SYNTAX);
SyntaxError(source, "SET SECUREFOUNDER", _("SET \037channel\037 SECUREFOUNDER {ON | OFF}"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_SET_SECUREFOUNDER);
source.Reply(_(" SECUREFOUNDER Stricter control of channel founder status"));
}
};
@@ -73,15 +79,9 @@ class CommandCSSASetSecureFounder : public CommandCSSetSecureFounder
{
}
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_SECUREFOUNDER, "SASET");
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SASET SECUREFOUNDER", CHAN_SASET_SECUREFOUNDER_SYNTAX);
SyntaxError(source, "SASET SECUREFOUNDER", _("SASET \002channel\002 SECUREFOUNDER {ON | OFF}"));
}
};
+10 -12
View File
@@ -29,12 +29,12 @@ class CommandCSSetSecureOps : public Command
if (params[1].equals_ci("ON"))
{
ci->SetFlag(CI_SECUREOPS);
source.Reply(CHAN_SET_SECUREOPS_ON, ci->name.c_str());
source.Reply(_("Secure ops option for %s is now \002\002."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_SECUREOPS);
source.Reply(CHAN_SET_SECUREOPS_OFF, ci->name.c_str());
source.Reply(_("Secure ops option for %s is now \002\002."), ci->name.c_str());
}
else
this->OnSyntaxError(source, "SECUREOPS");
@@ -44,18 +44,22 @@ class CommandCSSetSecureOps : public Command
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_SECUREOPS, "SET");
source.Reply(_("Syntax: \002SET \037%s\037 SECUREOPS {ON | OFF}\002\n"
" \n"
"Enables or disables the \002secure ops\002 option for a channel.\n"
"When \002secure ops\002 is set, users who are not on the userlist\n"
"will not be allowed chanop status."), this->name.c_str());
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SET SECUREOPS", CHAN_SET_SECUREOPS_SYNTAX);
SyntaxError(source, "SET SECUREOPS", _("SET \037channel\037 SECUREOPS {ON | OFF}"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_SET_SECUREOPS);
source.Reply(_(" SECUREOPS Stricter control of chanop status"));
}
};
@@ -66,15 +70,9 @@ class CommandCSSASetSecureOps : public CommandCSSetSecureOps
{
}
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_SECUREOPS, "SASET");
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SASET SECUREOPS", CHAN_SASET_SECUREOPS_SYNTAX);
SyntaxError(source, "SASET SECUREOPS", _("SASET \002channel\002 SECUREOPS {ON | OFF}"));
}
};
+17 -13
View File
@@ -30,19 +30,20 @@ class CommandCSSetSignKick : public Command
{
ci->SetFlag(CI_SIGNKICK);
ci->UnsetFlag(CI_SIGNKICK_LEVEL);
source.Reply(CHAN_SET_SIGNKICK_ON, ci->name.c_str());
source.Reply(_("Signed kick option for %s is now \002\002."), ci->name.c_str());
}
else if (params[1].equals_ci("LEVEL"))
{
ci->SetFlag(CI_SIGNKICK_LEVEL);
ci->UnsetFlag(CI_SIGNKICK);
source.Reply(CHAN_SET_SIGNKICK_LEVEL, ci->name.c_str());
source.Reply(_("Signed kick option for %s is now \002ON\002, but depends of the\n"
"level of the user that is using the command."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_SIGNKICK);
ci->UnsetFlag(CI_SIGNKICK_LEVEL);
source.Reply(CHAN_SET_SIGNKICK_OFF, ci->name.c_str());
source.Reply(_("Signed kick option for %s is now \002\002."), ci->name.c_str());
}
else
this->OnSyntaxError(source, "SIGNKICK");
@@ -52,18 +53,27 @@ class CommandCSSetSignKick : public Command
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_SIGNKICK, "SET");
source.Reply(_("Syntax: \002SET \037%s\037 SIGNKICK {ON | LEVEL | OFF}\002\n"
" \n"
"Enables or disables signed kicks for a\n"
"channel. When \002SIGNKICK\002 is set, kicks issued with\n"
"%S KICK command will have the nick that used the\n"
"command in their reason.\n"
" \n"
"If you use \002LEVEL\002, those who have a level that is superior \n"
"or equal to the SIGNKICK level on the channel won't have their \n"
"kicks signed. See \002%R%S HELP LEVELS\002 for more information."), this->name.c_str());
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SET SIGNKICK", CHAN_SET_SIGNKICK_SYNTAX);
SyntaxError(source, "SET SIGNKICK", _("SET \037channel\037 SIGNKICK {ON | LEVEL | OFF}"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_SET_SIGNKICK);
source.Reply(_(" SIGNKICK Sign kicks that are done with KICK command"));
}
};
@@ -74,15 +84,9 @@ class CommandCSSASetSignKick : public CommandCSSetSignKick
{
}
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_SIGNKICK, "SASET");
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SASET SIGNKICK", CHAN_SASET_SIGNKICK_SYNTAX);
SyntaxError(source, "SASET SIGNKICK", _("SASET \002channel\002 SIGNKICK {ON | OFF}"));
}
};
+18 -16
View File
@@ -29,7 +29,7 @@ class CommandCSSetSuccessor : public Command
if (this->permission.empty() && ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !check_access(u, ci, CA_FOUNDER))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
@@ -41,17 +41,17 @@ class CommandCSSetSuccessor : public Command
if (!na)
{
source.Reply(NICK_X_NOT_REGISTERED, params[1].c_str());
source.Reply(LanguageString::NICK_X_NOT_REGISTERED, params[1].c_str());
return MOD_CONT;
}
if (na->HasFlag(NS_FORBIDDEN))
{
source.Reply(NICK_X_FORBIDDEN, na->nick.c_str());
source.Reply(LanguageString::NICK_X_FORBIDDEN, na->nick.c_str());
return MOD_CONT;
}
if (na->nc == ci->founder)
{
source.Reply(CHAN_SUCCESSOR_IS_FOUNDER, na->nick.c_str(), ci->name.c_str());
source.Reply(_("%s cannot be the successor on channel %s because he is its founder."), na->nick.c_str(), ci->name.c_str());
return MOD_CONT;
}
nc = na->nc;
@@ -64,28 +64,36 @@ class CommandCSSetSuccessor : public Command
ci->successor = nc;
if (nc)
source.Reply(CHAN_SUCCESSOR_CHANGED, ci->name.c_str(), nc->display.c_str());
source.Reply(_("Successor for %s changed to \002%s\002."), ci->name.c_str(), nc->display.c_str());
else
source.Reply(CHAN_SUCCESSOR_UNSET, ci->name.c_str());
source.Reply(_("Successor for \002%s\002 unset."), ci->name.c_str());
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_SUCCESSOR, "SET");
source.Reply(_("Syntax: \002%s \037channel\037 SUCCESSOR \037nick\037\002\n"
" \n"
"Changes the successor of a channel. If the founder's\n"
"nickname expires or is dropped while the channel is still\n"
"registered, the successor will become the new founder of the\n"
"channel. However, if the successor already has too many\n"
"channels registered (%d), the channel will be dropped\n"
"instead, just as if no successor had been set. The new\n"
"nickname must be a registered one."), this->name.c_str());
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
// XXX
SyntaxError(source, "SET", CHAN_SET_SYNTAX);
SyntaxError(source, "SET", LanguageString::CHAN_SET_SYNTAX);
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_SET_SUCCESSOR);
source.Reply(_(" SUCCESSOR Set the successor for a channel"));
}
};
@@ -96,16 +104,10 @@ class CommandCSSASetSuccessor : public CommandCSSetSuccessor
{
}
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_SUCCESSOR, "SASET");
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
// XXX
SyntaxError(source, "SASET", CHAN_SASET_SYNTAX);
SyntaxError(source, "SASET", LanguageString::CHAN_SASET_SYNTAX);
}
};
+11 -12
View File
@@ -29,12 +29,12 @@ class CommandCSSetTopicLock : public Command
if (params[1].equals_ci("ON"))
{
ci->SetFlag(CI_TOPICLOCK);
source.Reply(CHAN_SET_TOPICLOCK_ON, ci->name.c_str());
source.Reply(_("Topic lock option for %s is now \002\002."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_TOPICLOCK);
source.Reply(CHAN_SET_TOPICLOCK_OFF, ci->name.c_str());
source.Reply(_("Topic lock option for %s is now \002\002."), ci->name.c_str());
}
else
this->OnSyntaxError(source, "TOPICLOCK");
@@ -44,18 +44,23 @@ class CommandCSSetTopicLock : public Command
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_TOPICLOCK, "SET");
source.Reply(_("Syntax: \002SET \037%s\037 TOPICLOCK {ON | OFF}\002\n"
" \n"
"Enables or disables the \002topic lock\002 option for a channel.\n"
"When \002topic lock\002 is set, %S will not allow the\n"
"channel topic to be changed except via the \002TOPIC\002\n"
"command."), this->name.c_str());
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SET", CHAN_SET_TOPICLOCK_SYNTAX);;
SyntaxError(source, "SET", _("SET \037channel\037 TOPICLOCK {ON | OFF}"));;
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_SET_TOPICLOCK);
source.Reply(_(" TOPICLOCK Topic can only be changed with TOPIC"));
}
};
@@ -66,15 +71,9 @@ class CommandCSSASetTopicLock : public CommandCSSetTopicLock
{
}
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_TOPICLOCK, "SASET");
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SASET", CHAN_SASET_TOPICLOCK_SYNTAX);
SyntaxError(source, "SASET", _("SASET \002channel\002 TOPICLOCK {ON | OFF}"));
}
};
+26 -13
View File
@@ -28,7 +28,7 @@ class CommandCSSetXOP : public Command
if (!FindModule("cs_xop"))
{
source.Reply(CHAN_XOP_NOT_AVAILABLE, "XOP");
source.Reply(_("xOP system is not available."), "XOP");
return MOD_CONT;
}
@@ -67,14 +67,14 @@ class CommandCSSetXOP : public Command
}
Log(LOG_COMMAND, u, this, ci) << "to enable XOP";
source.Reply(CHAN_SET_XOP_ON, ci->name.c_str());
source.Reply(_("xOP lists system for %s is now \002\002."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_XOP);
Log(LOG_COMMAND, u, this, ci) << "to disable XOP";
source.Reply(CHAN_SET_XOP_OFF, ci->name.c_str());
source.Reply(_("xOP lists system for %s is now \002\002."), ci->name.c_str());
}
else
this->OnSyntaxError(source, "XOP");
@@ -84,18 +84,37 @@ class CommandCSSetXOP : public Command
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_XOP, "SET");
source.Reply(_("Syntax: \002%s \037channel\037 XOP {ON | OFF}\002\n"
" \n"
"Enables or disables the xOP lists system for a channel.\n"
"When \002XOP\002 is set, you have to use the \002AOP\002/\002SOP\002/\002VOP\002\n"
"commands in order to give channel privileges to\n"
"users, else you have to use the \002ACCESS\002 command.\n"
" \n"
"\002Technical Note\002: when you switch from access list to xOP \n"
"lists system, your level definitions and user levels will be\n"
"changed, so you won't find the same values if you\n"
"switch back to access system! \n"
" \n"
"You should also check that your users are in the good xOP \n"
"list after the switch from access to xOP lists, because the \n"
"guess is not always perfect... in fact, it is not recommended \n"
"to use the xOP lists if you changed level definitions with \n"
"the \002LEVELS\002 command.\n"
" \n"
"Switching from xOP lists system to access list system\n"
"causes no problem though."), this->name.c_str());
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SET XOP", CHAN_SET_XOP_SYNTAX);
SyntaxError(source, "SET XOP", _("SET \037channel\037 XOP {ON | OFF}"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_SET_XOP);
source.Reply(_(" XOP Toggle the user privilege system"));
}
};
@@ -106,15 +125,9 @@ class CommandCSSASetXOP : public CommandCSSetXOP
{
}
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(CHAN_HELP_SET_XOP, "SASET");
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
SyntaxError(source, "SASET XOP", CHAN_SASET_XOP_SYNTAX);
SyntaxError(source, "SASET XOP", _("SASET \002channel\002 XOP {ON | OFF}"));
}
};
+14 -5
View File
@@ -28,26 +28,35 @@ class CommandCSStatus : public Command
User *u2 = finduser(nick);
ChanAccess *u2_access = ci->GetAccess(u2);
if (u2)
source.Reply(CHAN_STATUS_INFO, ci->name.c_str(), u2->nick.c_str(), u2_access ? u2_access->level : 0);
source.Reply(_("STATUS %s %s %d"), ci->name.c_str(), u2->nick.c_str(), u2_access ? u2_access->level : 0);
else /* !u2 */
source.Reply(CHAN_STATUS_NOTONLINE, nick.c_str());
source.Reply(_("STATUS ERROR Nick %s not online"), nick.c_str());
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_SERVADMIN_HELP_STATUS);
source.Reply(_("Syntax: \002STATUS \037channel\037 \037nickname\037\002\n"
" \n"
"Returns the current access level of the given nick on the\n"
"given channel. The reply is of the form:\n"
" \n"
" STATUS \037channel\037 \037nickname\037 \037access-level\037\n"
" \n"
"If an error occurs, the reply will be in the form:\n"
" \n"
" STATUS ERROR \037error-message\037"));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "STATUS", CHAN_STATUS_SYNTAX);
SyntaxError(source, "STATUS", _("STATUS \037channel\037 \037item\037"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_STATUS);
source.Reply(_(" STATUS Returns the current access level of a user on a channel"));
}
};
+24 -13
View File
@@ -38,12 +38,12 @@ class CommandCSSuspend : public Command
/* You should not SUSPEND a FORBIDEN channel */
if (ci->HasFlag(CI_FORBIDDEN))
{
source.Reply(CHAN_MAY_NOT_BE_REGISTERED, ci->name.c_str());
source.Reply(_("Channel \002%s\002 may not be registered."), ci->name.c_str());
return MOD_CONT;
}
if (readonly)
source.Reply(READ_ONLY_MODE);
source.Reply(LanguageString::READ_ONLY_MODE);
ci->SetFlag(CI_SUSPENDED);
ci->forbidby = u->nick;
@@ -59,7 +59,7 @@ class CommandCSSuspend : public Command
if (uc->user->HasMode(UMODE_OPER))
continue;
c->Kick(NULL, uc->user, "%s", !reason.empty() ? reason.c_str() : GetString(uc->user->Account(), CHAN_SUSPEND_REASON).c_str());
c->Kick(NULL, uc->user, "%s", !reason.empty() ? reason.c_str() : GetString(uc->user->Account(), _("This channel has been suspended.")).c_str());
}
}
@@ -67,7 +67,7 @@ class CommandCSSuspend : public Command
ircdproto->SendGlobops(ChanServ, "\2%s\2 used SUSPEND on channel \2%s\2", u->nick.c_str(), ci->name.c_str());
Log(LOG_ADMIN, u, this, ci) << (!reason.empty() ? reason : "No reason");
source.Reply(CHAN_SUSPEND_SUCCEEDED, ci->name.c_str());
source.Reply(_("Channel \002%s\002 is now suspended."), ci->name.c_str());
FOREACH_MOD(I_OnChanSuspend, OnChanSuspend(ci));
@@ -76,18 +76,26 @@ class CommandCSSuspend : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_SERVADMIN_HELP_SUSPEND);
source.Reply(_("Syntax: \002SUSPEND \037channel\037 [\037reason\037]\002\n"
" \n"
"Disallows anyone from registering or using the given\n"
"channel. May be cancelled by using the UNSUSPEND\n"
"command to preserve all previous channel data/settings.\n"
" \n"
"Reason may be required on certain networks."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "SUSPEND", Config->ForceForbidReason ? CHAN_SUSPEND_SYNTAX_REASON : CHAN_SUSPEND_SYNTAX);
SyntaxError(source, "SUSPEND", Config->ForceForbidReason ? _("SUSPEND \037channel\037 \037reason\037") : _("SUSPEND \037channel\037 \037freason\037"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_SUSPEND);
source.Reply(_(" SUSPEND Prevent a channel from being used preserving\n"
" channel data and settings"));
}
};
@@ -105,12 +113,12 @@ class CommandCSUnSuspend : public Command
ChannelInfo *ci = source.ci;
if (readonly)
source.Reply(READ_ONLY_MODE);
source.Reply(LanguageString::READ_ONLY_MODE);
/* Only UNSUSPEND already suspended channels */
if (!ci->HasFlag(CI_SUSPENDED))
{
source.Reply(CHAN_UNSUSPEND_FAILED, ci->name.c_str());
source.Reply(_("Couldn't release channel \002%s\002!"), ci->name.c_str());
return MOD_CONT;
}
@@ -123,7 +131,7 @@ class CommandCSUnSuspend : public Command
if (Config->WallForbid)
ircdproto->SendGlobops(ChanServ, "\2%s\2 used UNSUSPEND on channel \2%s\2", u->nick.c_str(), ci->name.c_str());
source.Reply(CHAN_UNSUSPEND_SUCCEEDED, ci->name.c_str());
source.Reply(_("Channel \002%s\002 is now released."), ci->name.c_str());
FOREACH_MOD(I_OnChanUnsuspend, OnChanUnsuspend(ci));
@@ -132,18 +140,21 @@ class CommandCSUnSuspend : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_SERVADMIN_HELP_UNSUSPEND);
source.Reply(_("Syntax: \002UNSUSPEND \037channel\037\002\n"
" \n"
"Releases a suspended channel. All data and settings\n"
"are preserved from before the suspension."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "UNSUSPEND", CHAN_UNSUSPEND_SYNTAX);
SyntaxError(source, "UNSUSPEND", _("UNSUSPEND \037channel\037"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_UNSUSPEND);
source.Reply(_(" UNSUSPEND Releases a suspended channel"));
}
};
+14 -5
View File
@@ -29,9 +29,9 @@ class CommandCSTopic : public Command
Channel *c = ci->c;
if (!c)
source.Reply(CHAN_X_NOT_IN_USE, ci->name.c_str());
source.Reply(LanguageString::CHAN_X_NOT_IN_USE, ci->name.c_str());
else if (!check_access(u, ci, CA_TOPIC) && !u->Account()->HasCommand("chanserv/topic"))
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
else
{
bool has_topiclock = ci->HasFlag(CI_TOPICLOCK);
@@ -48,18 +48,27 @@ class CommandCSTopic : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_TOPIC);
source.Reply(_("Syntax: \002TOPIC \037channel\037 [\037topic\037]\002\n"
" \n"
"Causes %S to set the channel topic to the one\n"
"specified. If \002topic\002 is not given, then an empty topic\n"
"is set. This command is most useful in conjunction\n"
"with \002SET TOPICLOCK\002. See \002%R%S HELP SET TOPICLOCK\002\n"
"for more information.\n"
" \n"
"By default, limited to those with founder access on the\n"
"channel."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "TOPIC", CHAN_TOPIC_SYNTAX);
SyntaxError(source, "TOPIC", _("TOPIC \037channel\037 [\037topic\037]"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_TOPIC);
source.Reply(_(" TOPIC Manipulate the topic of the specified channel"));
}
};
+14 -8
View File
@@ -28,13 +28,13 @@ class CommandCSUnban : public Command
if (!c)
{
source.Reply(CHAN_X_NOT_IN_USE, ci->name.c_str());
source.Reply(LanguageString::CHAN_X_NOT_IN_USE, ci->name.c_str());
return MOD_CONT;
}
if (!check_access(u, ci, CA_UNBAN))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
@@ -44,33 +44,39 @@ class CommandCSUnban : public Command
if (!u2)
{
source.Reply(NICK_X_NOT_IN_USE, params[1].c_str());
source.Reply(LanguageString::NICK_X_NOT_IN_USE, params[1].c_str());
return MOD_CONT;
}
common_unban(ci, u2, u == u2);
if (u2 == u)
source.Reply(CHAN_UNBANNED, c->name.c_str());
source.Reply(_("You have been unbanned from \002%s\002."), c->name.c_str());
else
source.Reply(CHAN_UNBANNED_OTHER, u2->nick.c_str(), c->name.c_str());
source.Reply(_("\002%s\002 has been unbanned from \002%s\002."), u2->nick.c_str(), c->name.c_str());
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_UNBAN);
source.Reply(_("Syntax: \002UNBAN \037channel\037 [\037nick\037]\002\n"
" \n"
"Tells %S to remove all bans preventing you or the given\n"
"user from entering the given channel. \n"
" \n"
"By default, limited to AOPs or those with level 5 and above\n"
"on the channel."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "UNBAN", CHAN_UNBAN_SYNTAX);
SyntaxError(source, "UNBAN", _("UNBAN \037channel\037 [\037nick\037]"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_UNBAN);
source.Reply(_(" UNBAN Remove all bans preventing a user from entering a channel"));
}
};
+245 -145
View File
@@ -23,94 +23,14 @@ enum
XOP_TYPES
};
enum
{
XOP_DISABLED,
XOP_ADDED,
XOP_MOVED,
XOP_NO_SUCH_ENTRY,
XOP_NOT_FOUND,
XOP_NO_MATCH,
XOP_DELETED,
XOP_DELETED_ONE,
XOP_DELETED_SEVERAL,
XOP_LIST_EMPTY,
XOP_LIST_HEADER,
XOP_CLEAR,
XOP_MESSAGES
};
LanguageString xop_msgs[XOP_TYPES][XOP_MESSAGES] = {
{CHAN_AOP_DISABLED,
CHAN_AOP_ADDED,
CHAN_AOP_MOVED,
CHAN_AOP_NO_SUCH_ENTRY,
CHAN_AOP_NOT_FOUND,
CHAN_AOP_NO_MATCH,
CHAN_AOP_DELETED,
CHAN_AOP_DELETED_ONE,
CHAN_AOP_DELETED_SEVERAL,
CHAN_AOP_LIST_EMPTY,
CHAN_AOP_LIST_HEADER,
CHAN_AOP_CLEAR},
{CHAN_SOP_DISABLED,
CHAN_SOP_ADDED,
CHAN_SOP_MOVED,
CHAN_SOP_NO_SUCH_ENTRY,
CHAN_SOP_NOT_FOUND,
CHAN_SOP_NO_MATCH,
CHAN_SOP_DELETED,
CHAN_SOP_DELETED_ONE,
CHAN_SOP_DELETED_SEVERAL,
CHAN_SOP_LIST_EMPTY,
CHAN_SOP_LIST_HEADER,
CHAN_SOP_CLEAR},
{CHAN_VOP_DISABLED,
CHAN_VOP_ADDED,
CHAN_VOP_MOVED,
CHAN_VOP_NO_SUCH_ENTRY,
CHAN_VOP_NOT_FOUND,
CHAN_VOP_NO_MATCH,
CHAN_VOP_DELETED,
CHAN_VOP_DELETED_ONE,
CHAN_VOP_DELETED_SEVERAL,
CHAN_VOP_LIST_EMPTY,
CHAN_VOP_LIST_HEADER,
CHAN_VOP_CLEAR},
{CHAN_HOP_DISABLED,
CHAN_HOP_ADDED,
CHAN_HOP_MOVED,
CHAN_HOP_NO_SUCH_ENTRY,
CHAN_HOP_NOT_FOUND,
CHAN_HOP_NO_MATCH,
CHAN_HOP_DELETED,
CHAN_HOP_DELETED_ONE,
CHAN_HOP_DELETED_SEVERAL,
CHAN_HOP_LIST_EMPTY,
CHAN_HOP_LIST_HEADER,
CHAN_HOP_CLEAR},
{CHAN_QOP_DISABLED,
CHAN_QOP_ADDED,
CHAN_QOP_MOVED,
CHAN_QOP_NO_SUCH_ENTRY,
CHAN_QOP_NOT_FOUND,
CHAN_QOP_NO_MATCH,
CHAN_QOP_DELETED,
CHAN_QOP_DELETED_ONE,
CHAN_QOP_DELETED_SEVERAL,
CHAN_QOP_LIST_EMPTY,
CHAN_QOP_LIST_HEADER,
CHAN_QOP_CLEAR}
};
class XOPListCallback : public NumberList
{
CommandSource &source;
int level;
LanguageString *messages;
Command *c;
bool SentHeader;
public:
XOPListCallback(CommandSource &_source, const Anope::string &numlist, int _level, LanguageString *_messages) : NumberList(numlist, false), source(_source), level(_level), messages(_messages), SentHeader(false)
XOPListCallback(CommandSource &_source, const Anope::string &numlist, int _level, Command *_c) : NumberList(numlist, false), source(_source), level(_level), c(_c), SentHeader(false)
{
}
@@ -127,15 +47,15 @@ class XOPListCallback : public NumberList
if (!SentHeader)
{
SentHeader = true;
source.Reply(messages[XOP_LIST_HEADER], source.ci->name.c_str());
source.Reply(_("%s list for %s:\n Num Nick"), this->c->name.c_str(), source.ci->name.c_str());
}
DoList(source, access, Number - 1, level, messages);
DoList(source, access, Number - 1, level);
}
static void DoList(CommandSource &source, ChanAccess *access, unsigned index, int level, LanguageString *messages)
static void DoList(CommandSource &source, ChanAccess *access, unsigned index, int level)
{
source.Reply(CHAN_XOP_LIST_FORMAT, index, access->mask.c_str());
source.Reply(_(" %3d %s"), index, access->mask.c_str());
}
};
@@ -143,27 +63,26 @@ class XOPDelCallback : public NumberList
{
CommandSource &source;
Command *c;
LanguageString *messages;
unsigned Deleted;
Anope::string Nicks;
bool override;
public:
XOPDelCallback(CommandSource &_source, Command *_c, LanguageString *_messages, bool _override, const Anope::string &numlist) : NumberList(numlist, true), source(_source), c(_c), messages(_messages), Deleted(0), override(_override)
XOPDelCallback(CommandSource &_source, Command *_c, bool _override, const Anope::string &numlist) : NumberList(numlist, true), source(_source), c(_c), Deleted(0), override(_override)
{
}
~XOPDelCallback()
{
if (!Deleted)
source.Reply(messages[XOP_NO_MATCH], source.ci->name.c_str());
source.Reply(_("No matching entries on %s %s list."), source.ci->name.c_str(), this->c->name.c_str());
else
{
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source.u, c, source.ci) << "deleted access of users " << Nicks;
if (Deleted == 1)
source.Reply(messages[XOP_DELETED_ONE], source.ci->name.c_str());
source.Reply(_("Deleted one entry from %s %s list."), source.ci->name.c_str(), this->c->name.c_str());
else
source.Reply(messages[XOP_DELETED_SEVERAL], Deleted, source.ci->name.c_str());
source.Reply(_("Deleted %d entries from %s %s list."), Deleted, source.ci->name.c_str(), this->c->name.c_str());
}
}
@@ -189,7 +108,7 @@ class XOPDelCallback : public NumberList
class XOPBase : public Command
{
private:
CommandReturn DoAdd(CommandSource &source, const std::vector<Anope::string> &params, int level, LanguageString *messages)
CommandReturn DoAdd(CommandSource &source, const std::vector<Anope::string> &params, int level)
{
User *u = source.u;
ChannelInfo *ci = source.ci;
@@ -205,7 +124,7 @@ class XOPBase : public Command
if (readonly)
{
source.Reply(messages[XOP_DISABLED]);
source.Reply(_("Sorry, channel %s list modification is temporarily disabled."), this->name.c_str());
return MOD_CONT;
}
@@ -214,7 +133,7 @@ class XOPBase : public Command
if ((level >= ulev || ulev < ACCESS_AOP) && !u->Account()->HasPriv("chanserv/access/modify"))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
@@ -223,7 +142,7 @@ class XOPBase : public Command
mask += "!*@*";
else if (na && na->HasFlag(NS_FORBIDDEN))
{
source.Reply(NICK_X_FORBIDDEN, na->nick.c_str());
source.Reply(LanguageString::NICK_X_FORBIDDEN, na->nick.c_str());
return MOD_CONT;
}
@@ -235,7 +154,7 @@ class XOPBase : public Command
**/
if (access->level >= ulev && !u->Account()->HasPriv("chanserv/access/modify"))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
++change;
@@ -243,7 +162,7 @@ class XOPBase : public Command
if (!change && ci->GetAccessCount() >= Config->CSAccessMax)
{
source.Reply(CHAN_XOP_REACHED_LIMIT, Config->CSAccessMax);
source.Reply(_("Sorry, you can only have %d %s entries on a channel."), Config->CSAccessMax, this->name.c_str());
return MOD_CONT;
}
@@ -262,18 +181,18 @@ class XOPBase : public Command
if (!change)
{
FOREACH_MOD(I_OnAccessAdd, OnAccessAdd(ci, u, access));
source.Reply(messages[XOP_ADDED], access->mask.c_str(), ci->name.c_str());
source.Reply(("\002%s\002 added to %s %s list."), access->mask.c_str(), ci->name.c_str(), this->name.c_str());
}
else
{
FOREACH_MOD(I_OnAccessChange, OnAccessChange(ci, u, access));
source.Reply(messages[XOP_MOVED], access->mask.c_str(), ci->name.c_str());
source.Reply(_("\002%s\002 moved to %s %s list."), access->mask.c_str(), ci->name.c_str(), this->name.c_str());
}
return MOD_CONT;
}
CommandReturn DoDel(CommandSource &source, const std::vector<Anope::string> &params, int level, LanguageString *messages)
CommandReturn DoDel(CommandSource &source, const std::vector<Anope::string> &params, int level)
{
User *u = source.u;
ChannelInfo *ci = source.ci;
@@ -288,13 +207,13 @@ class XOPBase : public Command
if (readonly)
{
source.Reply(messages[XOP_DISABLED]);
source.Reply(_("Sorry, channel %s list modification is temporarily disabled."), this->name.c_str());
return MOD_CONT;
}
if (!ci->GetAccessCount())
{
source.Reply(messages[XOP_LIST_EMPTY], ci->name.c_str());
source.Reply(_("%s %s list is empty."), ci->name.c_str(), this->name.c_str());
return MOD_CONT;
}
@@ -303,7 +222,7 @@ class XOPBase : public Command
if ((!access || access->nc != u->Account()) && (level >= ulev || ulev < ACCESS_AOP) && !u->Account()->HasPriv("chanserv/access/modify"))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
@@ -313,24 +232,24 @@ class XOPBase : public Command
if (isdigit(mask[0]) && mask.find_first_not_of("1234567890,-") == Anope::string::npos)
{
bool override = level >= ulev || ulev < ACCESS_AOP;
XOPDelCallback list(source, this, messages, override, mask);
XOPDelCallback list(source, this, override, mask);
list.Process();
}
else if (!access || access->level != level)
{
source.Reply(messages[XOP_NOT_FOUND], mask.c_str(), ci->name.c_str());
source.Reply(_("\002%s\002 not found on %s %s list."), mask.c_str(), ci->name.c_str(), this->name.c_str());
return MOD_CONT;
}
else
{
if (access->nc != u->Account() && ulev <= access->level && !u->Account()->HasPriv("chanserv/access/modify"))
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
else
{
bool override = ulev <= access->level;
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "DEL " << access->mask;
source.Reply(messages[XOP_DELETED], access->mask.c_str(), ci->name.c_str());
source.Reply(_("\002%s\002 deleted from %s %s list."), access->mask.c_str(), ci->name.c_str(), this->name.c_str());
FOREACH_MOD(I_OnAccessDel, OnAccessDel(ci, u, access));
@@ -341,7 +260,7 @@ class XOPBase : public Command
return MOD_CONT;
}
CommandReturn DoList(CommandSource &source, const std::vector<Anope::string> &params, int level, LanguageString *messages)
CommandReturn DoList(CommandSource &source, const std::vector<Anope::string> &params, int level)
{
User *u = source.u;
ChannelInfo *ci = source.ci;
@@ -353,7 +272,7 @@ class XOPBase : public Command
if (!ulev && !u->Account()->HasCommand("chanserv/access/list"))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
@@ -362,13 +281,13 @@ class XOPBase : public Command
if (!ci->GetAccessCount())
{
source.Reply(messages[XOP_LIST_EMPTY], ci->name.c_str());
source.Reply(_("%s %s list is empty."), ci->name.c_str(), this->name.c_str());
return MOD_CONT;
}
if (!nick.empty() && nick.find_first_not_of("1234567890,-") == Anope::string::npos)
{
XOPListCallback list(source, nick, level, messages);
XOPListCallback list(source, nick, level, this);
list.Process();
}
else
@@ -387,39 +306,39 @@ class XOPBase : public Command
if (!SentHeader)
{
SentHeader = true;
source.Reply(messages[XOP_LIST_HEADER], ci->name.c_str());
source.Reply(_("%s list for %s:\n Num Nick"), ci->name.c_str());
}
XOPListCallback::DoList(source, access, i + 1, level, messages);
XOPListCallback::DoList(source, access, i + 1, level);
}
if (!SentHeader)
source.Reply(messages[XOP_NO_MATCH], ci->name.c_str());
source.Reply(_("No matching entries on %s %s list."), ci->name.c_str(), this->name.c_str());
}
return MOD_CONT;
}
CommandReturn DoClear(CommandSource &source, int level, LanguageString *messages)
CommandReturn DoClear(CommandSource &source, int level)
{
User *u = source.u;
ChannelInfo *ci = source.ci;
if (readonly)
{
source.Reply(messages[XOP_DISABLED]);
source.Reply(_("Sorry, channel %s list modification is temporarily disabled."), this->name.c_str());
return MOD_CONT;
}
if (!ci->GetAccessCount())
{
source.Reply(messages[XOP_LIST_EMPTY], ci->name.c_str());
source.Reply(_("%s %s list is empty."), ci->name.c_str(), this->name.c_str());
return MOD_CONT;
}
if (!check_access(u, ci, CA_FOUNDER) && !u->Account()->HasPriv("chanserv/access/modify"))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
@@ -435,27 +354,29 @@ class XOPBase : public Command
FOREACH_MOD(I_OnAccessClear, OnAccessClear(ci, u));
source.Reply(messages[XOP_CLEAR], ci->name.c_str());
source.Reply(_("Channel %s %s list has been cleared."), ci->name.c_str(), this->name.c_str());
return MOD_CONT;
}
protected:
CommandReturn DoXop(CommandSource &source, const std::vector<Anope::string> &params, int level, LanguageString *messages)
CommandReturn DoXop(CommandSource &source, const std::vector<Anope::string> &params, int level)
{
ChannelInfo *ci = source.ci;
const Anope::string &cmd = params[1];
if (!ci->HasFlag(CI_XOP))
source.Reply(CHAN_XOP_ACCESS, Config->s_ChanServ.c_str());
source.Reply(_("You can't use this command. Use the ACCESS command instead.\n"
"Type \002%R%s HELP ACCESS\002 for more information."), Config->s_ChanServ.c_str());
else if (cmd.equals_ci("ADD"))
return this->DoAdd(source, params, level, messages);
return this->DoAdd(source, params, level);
else if (cmd.equals_ci("DEL"))
return this->DoDel(source, params, level, messages);
return this->DoDel(source, params, level);
else if (cmd.equals_ci("LIST"))
return this->DoList(source, params, level, messages);
return this->DoList(source, params, level);
else if (cmd.equals_ci("CLEAR"))
return this->DoClear(source, level, messages);
return this->DoClear(source, level);
else
this->OnSyntaxError(source, "");
@@ -488,23 +409,58 @@ class CommandCSQOP : public XOPBase
CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params)
{
return this->DoXop(source, params, ACCESS_QOP, xop_msgs[XOP_QOP]);
return this->DoXop(source, params, ACCESS_QOP);
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_QOP);
source.Reply(_("Syntax: \002QOP \037channel\037 ADD \037mask\037\002\n"
" \002QOP \037channel\037 DEL {\037mask\037 | \037entry-num\037 | \037list\037}\002\n"
" \002QOP \037channel\037 LIST [\037mask\037 | \037list\037]\002\n"
" \002QOP \037channel\037 CLEAR\002\n"
" \n"
"Maintains the \002QOP\002 (AutoOwner) \002list\002 for a channel. The QOP \n"
"list gives users the right to be auto-owner on your channel,\n"
"which gives them almost (or potentially, total) access.\n"
" \n"
"The \002QOP ADD\002 command adds the given nickname to the\n"
"QOP list.\n"
" \n"
"The \002QOP DEL\002 command removes the given nick from the\n"
"QOP list. If a list of entry numbers is given, those\n"
"entries are deleted. (See the example for LIST below.)\n"
" \n"
"The \002QOP LIST\002 command displays the QOP list. If\n"
"a wildcard mask is given, only those entries matching the\n"
"mask are displayed. If a list of entry numbers is given,\n"
"only those entries are shown; for example:\n"
" \002QOP #channel LIST 2-5,7-9\002\n"
" Lists QOP entries numbered 2 through 5 and\n"
" 7 through 9.\n"
" \n"
"The \002QOP CLEAR\002 command clears all entries of the\n"
"QOP list.\n"
" \n"
"The \002QOP\002 commands are limited to\n"
"founders (unless SECUREOPS is off). However, any user on the\n"
"QOP list may use the \002QOP LIST\002 command.\n"
" \n"
"This command may have been disabled for your channel, and\n"
"in that case you need to use the access list. See \n"
"\002%R%S HELP ACCESS\002 for information about the access list,\n"
"and \002%R%S HELP SET XOP\002 to know how to toggle between \n"
"the access list and xOP list systems."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "QOP", CHAN_QOP_SYNTAX);
SyntaxError(source, "QOP", _("QOP \037channel\037 {ADD|DEL|LIST|CLEAR} [\037nick\037 | \037entry-list\037]"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_QOP);
source.Reply(_(" QOP Modify the list of QOP users"));
}
};
@@ -517,23 +473,61 @@ class CommandCSAOP : public XOPBase
CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params)
{
return this->DoXop(source, params, ACCESS_AOP, xop_msgs[XOP_AOP]);
return this->DoXop(source, params, ACCESS_AOP);
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_AOP);
source.Reply(_("Syntax: \002AOP \037channel\037 ADD \037mask\037\002\n"
" \002AOP \037channel\037 DEL {\037mask\037 | \037entry-num\037 | \037list\037}\002\n"
" \002AOP \037channel\037 LIST [\037mask\037 | \037list\037]\002\n"
" \002AOP \037channel\037 CLEAR\002\n"
" \n"
"Maintains the \002AOP\002 (AutoOP) \002list\002 for a channel. The AOP \n"
"list gives users the right to be auto-opped on your channel,\n"
"to unban or invite themselves if needed, to have their\n"
"greet message showed on join, and so on.\n"
" \n"
"The \002AOP ADD\002 command adds the given nickname to the\n"
"AOP list.\n"
" \n"
"The \002AOP DEL\002 command removes the given nick from the\n"
"AOP list. If a list of entry numbers is given, those\n"
"entries are deleted. (See the example for LIST below.)\n"
" \n"
"The \002AOP LIST\002 command displays the AOP list. If\n"
"a wildcard mask is given, only those entries matching the\n"
"mask are displayed. If a list of entry numbers is given,\n"
"only those entries are shown; for example:\n"
" \002AOP #channel LIST 2-5,7-9\002\n"
" Lists AOP entries numbered 2 through 5 and\n"
" 7 through 9.\n"
" \n"
"The \002AOP CLEAR\002 command clears all entries of the\n"
"AOP list.\n"
" \n"
"The \002AOP ADD\002 and \002AOP DEL\002 commands are limited to\n"
"SOPs or above, while the \002AOP CLEAR\002 command can only\n"
"be used by the channel founder. However, any user on the\n"
"AOP list may use the \002AOP LIST\002 command.\n"
" \n"
"This command may have been disabled for your channel, and\n"
"in that case you need to use the access list. See \n"
"\002%R%S HELP ACCESS\002 for information about the access list,\n"
"and \002%R%S HELP SET XOP\002 to know how to toggle between \n"
"the access list and xOP list systems."));
/* CHAN_HELP_HOP */
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "AOP", CHAN_AOP_SYNTAX);
SyntaxError(source, "AOP", _("AOP \037channel\037 {ADD|DEL|LIST|CLEAR} [\037nick\037 | \037entry-list\037]"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_AOP);
source.Reply(_(" AOP Modify the list of AOP users"));
}
};
@@ -546,23 +540,58 @@ class CommandCSHOP : public XOPBase
CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params)
{
return this->DoXop(source, params, ACCESS_HOP, xop_msgs[XOP_HOP]);
return this->DoXop(source, params, ACCESS_HOP);
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_HOP);
source.Reply(_("Syntax: \002HOP \037channel\037 ADD \037mask\037\002\n"
" \002HOP \037channel\037 DEL {\037mask\037 | \037entry-num\037 | \037list\037}\002\n"
" \002HOP \037channel\037 LIST [\037mask\037 | \037list\037]\002\n"
" \002HOP \037channel\037 CLEAR\002\n"
" \n"
"Maintains the \002HOP\002 (HalfOP) \002list\002 for a channel. The HOP \n"
"list gives users the right to be auto-halfopped on your \n"
"channel.\n"
" \n"
"The \002HOP ADD\002 command adds the given nickname to the\n"
"HOP list.\n"
" \n"
"The \002HOP DEL\002 command removes the given nick from the\n"
"HOP list. If a list of entry numbers is given, those\n"
"entries are deleted. (See the example for LIST below.)\n"
" \n"
"The \002HOP LIST\002 command displays the HOP list. If\n"
"a wildcard mask is given, only those entries matching the\n"
"mask are displayed. If a list of entry numbers is given,\n"
"only those entries are shown; for example:\n"
" \002HOP #channel LIST 2-5,7-9\002\n"
" Lists HOP entries numbered 2 through 5 and\n"
" 7 through 9.\n"
" \n"
"The \002HOP CLEAR\002 command clears all entries of the\n"
"HOP list.\n"
" \n"
"The \002HOP ADD\002, \002HOP DEL\002 and \002HOP LIST\002 commands are \n"
"limited to AOPs or above, while the \002HOP CLEAR\002 command \n"
"can only be used by the channel founder.\n"
" \n"
"This command may have been disabled for your channel, and\n"
"in that case you need to use the access list. See \n"
"\002%R%S HELP ACCESS\002 for information about the access list,\n"
"and \002%R%S HELP SET XOP\002 to know how to toggle between \n"
"the access list and xOP list systems."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "HOP", CHAN_HOP_SYNTAX);
SyntaxError(source, "HOP", _("HOP \037channel\037 {ADD|DEL|LIST|CLEAR} [\037nick\037 | \037entry-list\037]"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_HOP);
source.Reply(_(" HOP Maintains the HOP (HalfOP) list for a channel"));
}
};
@@ -575,23 +604,59 @@ class CommandCSSOP : public XOPBase
CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params)
{
return this->DoXop(source, params, ACCESS_SOP, xop_msgs[XOP_SOP]);
return this->DoXop(source, params, ACCESS_SOP);
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_SOP);
source.Reply(_("Syntax: \002SOP \037channel\037 ADD \037mask\037\002\n"
" \002SOP \037channel\037 DEL {\037mask\037 | \037entry-num\037 | \037list\037}\002\n"
" \002SOP \037channel\037 LIST [\037mask\037 | \037list\037]\002\n"
" \002SOP \037channel\037 CLEAR\002\n"
" \n"
"Maintains the \002SOP\002 (SuperOP) \002list\002 for a channel. The SOP \n"
"list gives users all rights given by the AOP list, and adds\n"
"those needed to use the AutoKick and the BadWords lists, \n"
"to send and read channel memos, and so on.\n"
" \n"
"The \002SOP ADD\002 command adds the given nickname to the\n"
"SOP list.\n"
" \n"
"The \002SOP DEL\002 command removes the given nick from the\n"
"SOP list. If a list of entry numbers is given, those\n"
"entries are deleted. (See the example for LIST below.)\n"
" \n"
"The \002SOP LIST\002 command displays the SOP list. If\n"
"a wildcard mask is given, only those entries matching the\n"
"mask are displayed. If a list of entry numbers is given,\n"
"only those entries are shown; for example:\n"
" \002SOP #channel LIST 2-5,7-9\002\n"
" Lists AOP entries numbered 2 through 5 and\n"
" 7 through 9.\n"
" \n"
"The \002SOP CLEAR\002 command clears all entries of the\n"
"SOP list.\n"
" \n"
"The \002SOP ADD\002, \002SOP DEL\002 and \002SOP CLEAR\002 commands are \n"
"limited to the channel founder. However, any user on the\n"
"AOP list may use the \002SOP LIST\002 command.\n"
" \n"
"This command may have been disabled for your channel, and\n"
"in that case you need to use the access list. See \n"
"\002%R%S HELP ACCESS\002 for information about the access list,\n"
"and \002%R%S HELP SET XOP\002 to know how to toggle between \n"
"the access list and xOP list systems."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "SOP", CHAN_SOP_SYNTAX);
SyntaxError(source, "SOP", _("SOP \037channel\037 {ADD|DEL|LIST|CLEAR} [\037nick\037 | \037entry-list\037]"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_SOP);
source.Reply(_(" SOP Modify the list of SOP users"));
}
};
@@ -604,23 +669,58 @@ class CommandCSVOP : public XOPBase
CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params)
{
return this->DoXop(source, params, ACCESS_VOP, xop_msgs[XOP_VOP]);
return this->DoXop(source, params, ACCESS_VOP);
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(CHAN_HELP_VOP);
source.Reply(_("Syntax: \002VOP \037channel\037 ADD \037mask\037\002\n"
" \002VOP \037channel\037 DEL {\037mask\037 | \037entry-num\037 | \037list\037}\002\n"
" \002VOP \037channel\037 LIST [\037mask\037 | \037list\037]\002\n"
" \002VOP \037channel\037 CLEAR\002\n"
" \n"
"Maintains the \002VOP\002 (VOicePeople) \002list\002 for a channel. \n"
"The VOP list allows users to be auto-voiced and to voice \n"
"themselves if they aren't.\n"
" \n"
"The \002VOP ADD\002 command adds the given nickname to the\n"
"VOP list.\n"
" \n"
"The \002VOP DEL\002 command removes the given nick from the\n"
"VOP list. If a list of entry numbers is given, those\n"
"entries are deleted. (See the example for LIST below.)\n"
" \n"
"The \002VOP LIST\002 command displays the VOP list. If\n"
"a wildcard mask is given, only those entries matching the\n"
"mask are displayed. If a list of entry numbers is given,\n"
"only those entries are shown; for example:\n"
" \002VOP #channel LIST 2-5,7-9\002\n"
" Lists VOP entries numbered 2 through 5 and\n"
" 7 through 9.\n"
" \n"
"The \002VOP CLEAR\002 command clears all entries of the\n"
"VOP list.\n"
" \n"
"The \002VOP ADD\002, \002VOP DEL\002 and \002VOP LIST\002 commands are \n"
"limited to AOPs or above, while the \002VOP CLEAR\002 command \n"
"can only be used by the channel founder.\n"
" \n"
"This command may have been disabled for your channel, and\n"
"in that case you need to use the access list. See \n"
"\002%R%S HELP ACCESS\002 for information about the access list,\n"
"and \002%R%S HELP SET XOP\002 to know how to toggle between \n"
"the access list and xOP list systems."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "VOP", CHAN_VOP_SYNTAX);
SyntaxError(source, "VOP", _("VOP \037channel\037 {ADD|DEL|LIST|CLEAR} [\037nick\037 | \037entry-list\037]"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(CHAN_HELP_CMD_VOP);
source.Reply(_(" VOP Maintains the VOP (VOicePeople) list for a channel"));
}
};
+8 -6
View File
@@ -29,34 +29,36 @@ class CommandHSDel : public Command
{
if (na->HasFlag(NS_FORBIDDEN))
{
source.Reply(NICK_X_FORBIDDEN, nick.c_str());
source.Reply(LanguageString::NICK_X_FORBIDDEN, nick.c_str());
return MOD_CONT;
}
Log(LOG_ADMIN, u, this) << "for user " << na->nick;
FOREACH_MOD(I_OnDeleteVhost, OnDeleteVhost(na));
na->hostinfo.RemoveVhost();
source.Reply(HOST_DEL, nick.c_str());
source.Reply(_("vhost for \002%s\002 removed."), nick.c_str());
}
else
source.Reply(HOST_NOREG, nick.c_str());
source.Reply(LanguageString::NICK_X_NOT_REGISTERED, nick.c_str());
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(HOST_HELP_DEL);
source.Reply(_("Syntax: \002DEL\002 \002<nick>\002\n"
"Deletes the vhost assigned to the given nick from the\n"
"database."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "DEL", HOST_DEL_SYNTAX);
SyntaxError(source, "DEL", _("DEL \002<nick>\002."));
}
void OnServHelp(CommandSource &source)
{
source.Reply(HOST_HELP_CMD_DEL);
source.Reply(_(" DEL Delete the vhost of another user"));
}
};
+8 -6
View File
@@ -29,7 +29,7 @@ class CommandHSDelAll : public Command
{
if (na->HasFlag(NS_FORBIDDEN))
{
source.Reply(NICK_X_FORBIDDEN, nick.c_str());
source.Reply(LanguageString::NICK_X_FORBIDDEN, nick.c_str());
return MOD_CONT;
}
FOREACH_MOD(I_OnDeleteVhost, OnDeleteVhost(na));
@@ -40,28 +40,30 @@ class CommandHSDelAll : public Command
na->hostinfo.RemoveVhost();
}
Log(LOG_ADMIN, u, this) << "for all nicks in group " << nc->display;
source.Reply(HOST_DELALL, nc->display.c_str());
source.Reply(_("vhosts for group \002%s\002 have been removed."), nc->display.c_str());
}
else
source.Reply(HOST_NOREG, nick.c_str());
source.Reply(LanguageString::NICK_X_NOT_REGISTERED, nick.c_str());
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(HOST_HELP_DELALL);
source.Reply(_("Syntax: \002DELALL\002 \002<nick>\002.\n"
"Deletes the vhost for all nicks in the same group as\n"
"that of the given nick."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "DELALL", HOST_DELALL_SYNTAX);
SyntaxError(source, "DELALL", _("DELALL <nick>\002."));
}
void OnServHelp(CommandSource &source)
{
source.Reply(HOST_HELP_CMD_DELALL);
source.Reply(_(" DELALL Delete the vhost for all nicks in a group"));
}
};
+9 -5
View File
@@ -28,25 +28,29 @@ class CommandHSGroup : public Command
{
HostServSyncVhosts(na);
if (!na->hostinfo.GetIdent().empty())
source.Reply(HOST_IDENT_GROUP, u->Account()->display.c_str(), na->hostinfo.GetIdent().c_str(), na->hostinfo.GetHost().c_str());
source.Reply(_("All vhost's in the group \002%s\002 have been set to \002%s\002@\002%s\002"), u->Account()->display.c_str(), na->hostinfo.GetIdent().c_str(), na->hostinfo.GetHost().c_str());
else
source.Reply(HOST_GROUP, u->Account()->display.c_str(), na->hostinfo.GetHost().c_str());
source.Reply(_("All vhost's in the group \002%s\002 have been set to \002%s\002"), u->Account()->display.c_str(), na->hostinfo.GetHost().c_str());
}
else
source.Reply(HOST_NOT_ASSIGNED);
source.Reply(LanguageString::HOST_NOT_ASSIGNED);
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(HOST_HELP_GROUP);
source.Reply(_("Syntax: \002GROUP\002\n"
" \n"
"This command allows users to set the vhost of their\n"
"CURRENT nick to be the vhost for all nicks in the same\n"
"group."));
return true;
}
void OnServHelp(CommandSource &source)
{
source.Reply(HOST_HELP_CMD_GROUP);
source.Reply(_(" GROUP Syncs the vhost for all nicks in a group"));
}
};
+1 -1
View File
@@ -30,7 +30,7 @@ class CommandHSHelp : public Command
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
User *u = source.u;
source.Reply(OPER_HELP, Config->s_HostServ.c_str());
source.Reply(_("%s commands"), Config->s_HostServ.c_str());
for (CommandMap::const_iterator it = HostServ->Commands.begin(), it_end = HostServ->Commands.end(); it != it_end; ++it)
if (!Config->HidePrivilegedCommands || it->second->permission.empty() || (u->Account() && u->Account()->HasCommand(it->second->permission)))
it->second->OnServHelp(source);
+20 -11
View File
@@ -35,14 +35,14 @@ class CommandHSList : public Command
size_t tmp = key.find('-');
if (tmp == Anope::string::npos || tmp == key.length() || tmp == 1)
{
source.Reply(LIST_INCORRECT_RANGE);
source.Reply(LanguageString::LIST_INCORRECT_RANGE);
return MOD_CONT;
}
for (unsigned i = 1, end = key.length(); i < end; ++i)
{
if (!isdigit(key[i]) && i != tmp)
{
source.Reply(LIST_INCORRECT_RANGE);
source.Reply(LanguageString::LIST_INCORRECT_RANGE);
return MOD_CONT;
}
from = convertTo<int>(key.substr(1, tmp - 1));
@@ -63,9 +63,9 @@ class CommandHSList : public Command
{
++display_counter;
if (!na->hostinfo.GetIdent().empty())
source.Reply(HOST_IDENT_ENTRY, counter, na->nick.c_str(), na->hostinfo.GetIdent().c_str(), na->hostinfo.GetHost().c_str(), na->hostinfo.GetCreator().c_str(), do_strftime(na->hostinfo.GetTime()).c_str());
source.Reply(_("#%d Nick:\002%s\002, vhost:\002%s\002@\002%s\002 (%s - %s)"), counter, na->nick.c_str(), na->hostinfo.GetIdent().c_str(), na->hostinfo.GetHost().c_str(), na->hostinfo.GetCreator().c_str(), do_strftime(na->hostinfo.GetTime()).c_str());
else
source.Reply(HOST_ENTRY, counter, na->nick.c_str(), na->hostinfo.GetHost().c_str(), na->hostinfo.GetCreator().c_str(), do_strftime(na->hostinfo.GetTime()).c_str());
source.Reply(_("#%d Nick:\002%s\002, vhost:\002%s\002 (%s - %s)"), counter, na->nick.c_str(), na->hostinfo.GetHost().c_str(), na->hostinfo.GetCreator().c_str(), do_strftime(na->hostinfo.GetTime()).c_str());
}
}
else
@@ -78,34 +78,43 @@ class CommandHSList : public Command
{
++display_counter;
if (!na->hostinfo.GetIdent().empty())
source.Reply(HOST_IDENT_ENTRY, counter, na->nick.c_str(), na->hostinfo.GetIdent().c_str(), na->hostinfo.GetHost().c_str(), na->hostinfo.GetCreator().c_str(), do_strftime(na->hostinfo.GetTime()).c_str());
source.Reply(_("#%d Nick:\002%s\002, vhost:\002%s\002@\002%s\002 (%s - %s)"), counter, na->nick.c_str(), na->hostinfo.GetIdent().c_str(), na->hostinfo.GetHost().c_str(), na->hostinfo.GetCreator().c_str(), do_strftime(na->hostinfo.GetTime()).c_str());
else
source.Reply(HOST_ENTRY, counter, na->nick.c_str(), na->hostinfo.GetHost().c_str(), na->hostinfo.GetCreator().c_str(), do_strftime(na->hostinfo.GetTime()).c_str());
source.Reply(_("#%d Nick:\002%s\002, vhost:\002%s\002 (%s - %s)"), counter, na->nick.c_str(), na->hostinfo.GetHost().c_str(), na->hostinfo.GetCreator().c_str(), do_strftime(na->hostinfo.GetTime()).c_str());
}
}
++counter;
}
if (!key.empty())
source.Reply(HOST_LIST_KEY_FOOTER, key.c_str(), display_counter);
source.Reply(_("Displayed records matching key \002%s\002 (Count: \002%d\002)"), key.c_str(), display_counter);
else
{
if (from)
source.Reply(HOST_LIST_RANGE_FOOTER, from, to);
source.Reply(_("Displayed records from \002%d\002 to \002%d\002"), from, to);
else
source.Reply(HOST_LIST_FOOTER, display_counter);
source.Reply(_("Displayed all records (Count: \002%d\002)"), display_counter);
}
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(HOST_HELP_LIST);
source.Reply(_("Syntax: \002LIST\002 \002[<key>|<#X-Y>]\002\n"
"This command lists registered vhosts to the operator\n"
"if a Key is specified, only entries whos nick or vhost match\n"
"the pattern given in <key> are displayed e.g. Rob* for all\n"
"entries beginning with \"Rob\"\n"
"If a #X-Y style is used, only entries between the range of X\n"
"and Y will be displayed, e.g. #1-3 will display the first 3\n"
"nick/vhost entries.\n"
"The list uses the value of NSListMax as a hard limit for the\n"
"number of items to display to a operator at any 1 time."));
return true;
}
void OnServHelp(CommandSource &source)
{
source.Reply(HOST_HELP_CMD_LIST);
source.Reply(_(" LIST Displays one or more vhost entries."));
}
};
+7 -4
View File
@@ -26,12 +26,12 @@ class CommandHSOff : public Command
NickAlias *na = findnick(u->nick);
if (!na || !na->hostinfo.HasVhost())
source.Reply(HOST_NOT_ASSIGNED);
source.Reply(LanguageString::HOST_NOT_ASSIGNED);
else
{
ircdproto->SendVhostDel(u);
Log(LOG_COMMAND, u, this) << "to disable their vhost";
source.Reply(HOST_OFF);
source.Reply(_("Your vhost was removed and the normal cloaking restored."));
}
return MOD_CONT;
@@ -39,13 +39,16 @@ class CommandHSOff : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(HOST_HELP_OFF);
source.Reply(_("Syntax: \002OFF\002\n"
"Deactivates the vhost currently assigned to the nick in use.\n"
"When you use this command any user who performs a /whois\n"
"on you will see your real IP address."));
return true;
}
void OnServHelp(CommandSource &source)
{
source.Reply(HOST_HELP_CMD_OFF);
source.Reply(_(" OFF Deactivates your assigned vhost"));
}
};
+8 -5
View File
@@ -27,9 +27,9 @@ class CommandHSOn : public Command
if (na && u->Account() == na->nc && na->hostinfo.HasVhost())
{
if (!na->hostinfo.GetIdent().empty())
source.Reply(HOST_IDENT_ACTIVATED, na->hostinfo.GetIdent().c_str(), na->hostinfo.GetHost().c_str());
source.Reply(_("Your vhost of \002%s\002@\002%s\002 is now activated."), na->hostinfo.GetIdent().c_str(), na->hostinfo.GetHost().c_str());
else
source.Reply(HOST_ACTIVATED, na->hostinfo.GetHost().c_str());
source.Reply(_("Your vhost of \002%s\002 is now activated."), na->hostinfo.GetHost().c_str());
Log(LOG_COMMAND, u, this) << "to enable their vhost of " << (!na->hostinfo.GetIdent().empty() ? na->hostinfo.GetIdent() + "@" : "") << na->hostinfo.GetHost();
ircdproto->SendVhost(u, na->hostinfo.GetIdent(), na->hostinfo.GetHost());
if (ircd->vhost)
@@ -42,20 +42,23 @@ class CommandHSOn : public Command
u->UpdateHost();
}
else
source.Reply(HOST_NOT_ASSIGNED);
source.Reply(LanguageString::HOST_NOT_ASSIGNED);
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(HOST_HELP_ON);
source.Reply(_("Syntax: \002ON\002\n"
"Activates the vhost currently assigned to the nick in use.\n"
"When you use this command any user who performs a /whois\n"
"on you will see the vhost instead of your real IP address."));
return true;
}
void OnServHelp(CommandSource &source)
{
source.Reply(HOST_HELP_CMD_ON);
source.Reply(_(" ON Activates your assigned vhost"));
}
};
+18 -13
View File
@@ -34,12 +34,12 @@ class CommandHSSet : public Command
rawhostmask = myStrGetTokenRemainder(rawhostmask, '@', 1); /* get the remaining string */
if (rawhostmask.empty())
{
source.Reply(HOST_SET_SYNTAX, Config->s_HostServ.c_str());
source.Reply(_("SET \002<nick>\002 \002<hostmask>\002."), Config->s_HostServ.c_str());
return MOD_CONT;
}
if (vIdent.length() > Config->UserLen)
{
source.Reply(HOST_SET_IDENTTOOLONG, Config->UserLen);
source.Reply(LanguageString::HOST_SET_IDENTTOOLONG, Config->UserLen);
return MOD_CONT;
}
else
@@ -47,13 +47,13 @@ class CommandHSSet : public Command
for (Anope::string::iterator s = vIdent.begin(), s_end = vIdent.end(); s != s_end; ++s)
if (!isvalidchar(*s))
{
source.Reply(HOST_SET_IDENT_ERROR);
source.Reply(LanguageString::HOST_SET_IDENT_ERROR);
return MOD_CONT;
}
}
if (!ircd->vident)
{
source.Reply(HOST_NO_VIDENT);
source.Reply(LanguageString::HOST_NO_VIDENT);
return MOD_CONT;
}
}
@@ -61,13 +61,13 @@ class CommandHSSet : public Command
hostmask = rawhostmask;
else
{
source.Reply(HOST_SET_TOOLONG, Config->HostLen);
source.Reply(LanguageString::HOST_SET_TOOLONG, Config->HostLen);
return MOD_CONT;
}
if (!isValidHost(hostmask, 3))
{
source.Reply(HOST_SET_ERROR);
source.Reply(LanguageString::HOST_SET_ERROR);
return MOD_CONT;
}
@@ -76,7 +76,7 @@ class CommandHSSet : public Command
{
if (na->HasFlag(NS_FORBIDDEN))
{
source.Reply(NICK_X_FORBIDDEN, nick.c_str());
source.Reply(LanguageString::NICK_X_FORBIDDEN, nick.c_str());
return MOD_CONT;
}
@@ -85,29 +85,34 @@ class CommandHSSet : public Command
na->hostinfo.SetVhost(vIdent, hostmask, u->nick);
FOREACH_MOD(I_OnSetVhost, OnSetVhost(na));
if (!vIdent.empty())
source.Reply(HOST_IDENT_SET, nick.c_str(), vIdent.c_str(), hostmask.c_str());
source.Reply(_("vhost for \002%s\002 set to \002%s\002@\002%s\002."), nick.c_str(), vIdent.c_str(), hostmask.c_str());
else
source.Reply(HOST_SET, nick.c_str(), hostmask.c_str());
source.Reply(_("vhost for \002%s\002 set to \002%s\002."), nick.c_str(), hostmask.c_str());
}
else
source.Reply(HOST_NOREG, nick.c_str());
source.Reply(LanguageString::NICK_X_NOT_REGISTERED, nick.c_str());
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(HOST_HELP_SET);
source.Reply(_("Syntax: \002SET\002 \002<nick>\002 \002<hostmask>\002.\n"
"Sets the vhost for the given nick to that of the given\n"
"hostmask. If your IRCD supports vIdents, then using\n"
"SET <nick> <ident>@<hostmask> set idents for users as \n"
"well as vhosts."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "SET", HOST_SET_SYNTAX);
SyntaxError(source, "SET", _("SET \002<nick>\002 \002<hostmask>\002."));
}
void OnServHelp(CommandSource &source)
{
source.Reply(HOST_HELP_CMD_SET);
source.Reply(_(" SET Set the vhost of another user"));
}
};
+19 -13
View File
@@ -32,12 +32,12 @@ class CommandHSSetAll : public Command
NickAlias *na = findnick(nick);
if (!na)
{
source.Reply(HOST_NOREG, nick.c_str());
source.Reply(LanguageString::NICK_X_NOT_REGISTERED, nick.c_str());
return MOD_CONT;
}
else if (na->HasFlag(NS_FORBIDDEN))
{
source.Reply(NICK_X_FORBIDDEN, nick.c_str());
source.Reply(LanguageString::NICK_X_FORBIDDEN, nick.c_str());
return MOD_CONT;
}
@@ -47,12 +47,12 @@ class CommandHSSetAll : public Command
rawhostmask = myStrGetTokenRemainder(rawhostmask, '@', 1); /* get the remaining string */
if (rawhostmask.empty())
{
source.Reply(HOST_SETALL_SYNTAX, Config->s_HostServ.c_str());
source.Reply(_("vhost for group \002%s\002 set to \002%s\002."), Config->s_HostServ.c_str());
return MOD_CONT;
}
if (vIdent.length() > Config->UserLen)
{
source.Reply(HOST_SET_IDENTTOOLONG, Config->UserLen);
source.Reply(LanguageString::HOST_SET_IDENTTOOLONG, Config->UserLen);
return MOD_CONT;
}
else
@@ -60,13 +60,13 @@ class CommandHSSetAll : public Command
for (Anope::string::iterator s = vIdent.begin(), s_end = vIdent.end(); s != s_end; ++s)
if (!isvalidchar(*s))
{
source.Reply(HOST_SET_IDENT_ERROR);
source.Reply(LanguageString::HOST_SET_IDENT_ERROR);
return MOD_CONT;
}
}
if (!ircd->vident)
{
source.Reply(HOST_NO_VIDENT);
source.Reply(LanguageString::HOST_NO_VIDENT);
return MOD_CONT;
}
}
@@ -76,13 +76,13 @@ class CommandHSSetAll : public Command
hostmask = rawhostmask;
else
{
source.Reply(HOST_SET_TOOLONG, Config->HostLen);
source.Reply(LanguageString::HOST_SET_TOOLONG, Config->HostLen);
return MOD_CONT;
}
if (!isValidHost(hostmask, 3))
{
source.Reply(HOST_SET_ERROR);
source.Reply(LanguageString::HOST_SET_ERROR);
return MOD_CONT;
}
@@ -94,26 +94,32 @@ class CommandHSSetAll : public Command
HostServSyncVhosts(na);
FOREACH_MOD(I_OnSetVhost, OnSetVhost(na));
if (!vIdent.empty())
source.Reply(HOST_IDENT_SETALL, nick.c_str(), vIdent.c_str(), hostmask.c_str());
source.Reply(_("vhost for group \002%s\002 set to \002%s\002@\002%s\002."), nick.c_str(), vIdent.c_str(), hostmask.c_str());
else
source.Reply(HOST_SETALL, nick.c_str(), hostmask.c_str());
source.Reply(_("vhost for group \002%s\002 set to \002%s\002."), nick.c_str(), hostmask.c_str());
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(HOST_HELP_SETALL);
source.Reply(_("Syntax: \002SETALL\002 \002<nick>\002 \002<hostmask>\002.\n"
"Sets the vhost for all nicks in the same group as that\n"
"of the given nick. If your IRCD supports vIdents, then\n"
"using SETALL <nick> <ident>@<hostmask> will set idents\n"
"for users as well as vhosts.\n"
"* NOTE, this will not update the vhost for any nicks\n"
"added to the group after this command was used."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "SETALL", HOST_SETALL_SYNTAX);
SyntaxError(source, "SETALL", _("SETALL \002<nick>\002 \002<hostmask>\002."));
}
void OnServHelp(CommandSource &source)
{
source.Reply(HOST_HELP_CMD_SETALL);
source.Reply(_(" SETALL Set the vhost for all nicks in a group"));
}
};
+10 -7
View File
@@ -34,9 +34,9 @@ class CommandMSCancel : public Command
if (!(mi = getmemoinfo(nname, ischan, isforbid)))
{
if (isforbid)
source.Reply(ischan ? CHAN_X_FORBIDDEN : NICK_X_FORBIDDEN, nname.c_str());
source.Reply(ischan ? LanguageString::CHAN_X_FORBIDDEN : LanguageString::NICK_X_FORBIDDEN, nname.c_str());
else
source.Reply(ischan ? CHAN_X_NOT_REGISTERED : NICK_X_NOT_REGISTERED, nname.c_str());
source.Reply(ischan ? LanguageString::CHAN_X_NOT_REGISTERED : LanguageString::NICK_X_NOT_REGISTERED, nname.c_str());
}
else
{
@@ -45,29 +45,32 @@ class CommandMSCancel : public Command
{
FOREACH_MOD(I_OnMemoDel, OnMemoDel(findnick(nname)->nc, mi, mi->memos[i]));
mi->Del(mi->memos[i]);
source.Reply(MEMO_CANCELLED, nname.c_str());
source.Reply(_("Last memo to \002%s\002 has been cancelled."), nname.c_str());
return MOD_CONT;
}
source.Reply(MEMO_CANCEL_NONE);
source.Reply(_("No memo was cancelable."));
}
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(MEMO_HELP_CANCEL);
source.Reply(_("Syntax: \002CANCEL {\037nick\037 | \037channel\037}\002\n"
" \n"
"Cancels the last memo you sent to the given nick or channel,\n"
"provided it has not been read at the time you use the command."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "CANCEL", MEMO_CANCEL_SYNTAX);
SyntaxError(source, "CANCEL", _("CANCEL {\037nick\037 | \037channel\037}"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(MEMO_HELP_CMD_CANCEL);
source.Reply(_(" CANCEL Cancel last memo you sent"));
}
};
+11 -8
View File
@@ -31,13 +31,13 @@ class CommandMSCheck : public Command
NickAlias *na = findnick(recipient);
if (!na)
{
source.Reply(NICK_X_NOT_REGISTERED, recipient.c_str());
source.Reply(LanguageString::NICK_X_NOT_REGISTERED, recipient.c_str());
return MOD_CONT;
}
if (na->HasFlag(NS_FORBIDDEN))
{
source.Reply(NICK_X_FORBIDDEN, recipient.c_str());
source.Reply(LanguageString::NICK_X_FORBIDDEN, recipient.c_str());
return MOD_CONT;
}
@@ -53,33 +53,36 @@ class CommandMSCheck : public Command
found = true; /* Yes, we've found the memo */
if (mi->memos[i]->HasFlag(MF_UNREAD))
source.Reply(MEMO_CHECK_NOT_READ, na->nick.c_str(), do_strftime(mi->memos[i]->time).c_str());
source.Reply(_("The last memo you sent to %s (sent on %s) has not yet been read."), na->nick.c_str(), do_strftime(mi->memos[i]->time).c_str());
else
source.Reply(MEMO_CHECK_READ, na->nick.c_str(), do_strftime(mi->memos[i]->time).c_str());
source.Reply(_("The last memo you sent to %s (sent on %s) has been read."), na->nick.c_str(), do_strftime(mi->memos[i]->time).c_str());
break;
}
}
if (!found)
source.Reply(MEMO_CHECK_NO_MEMO, na->nick.c_str());
source.Reply(_("Nick %s doesn't have a memo from you."), na->nick.c_str());
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(MEMO_HELP_CHECK);
source.Reply(_("Syntax: \002CHECK \037nick\037\002\n"
" \n"
"Checks whether the _last_ memo you sent to \037nick\037 has been read\n"
"or not. Note that this does only work with nicks, not with chans."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "CHECK", MEMO_CHECK_SYNTAX);
SyntaxError(source, "CHECK", _("CHECK \037nickname\037"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(MEMO_HELP_CMD_CHECK);
source.Reply(_(" CHECK Checks if last memo to a nick was read"));
}
};
+27 -12
View File
@@ -34,7 +34,7 @@ class MemoDelCallback : public NumberList
FOREACH_MOD(I_OnMemoDel, OnMemoDel(source.u->Account(), mi, mi->memos[Number - 1]));
mi->Del(Number - 1);
source.Reply(MEMO_DELETED_ONE, Number);
source.Reply(_("Memo %d has been deleted."), Number);
}
};
@@ -60,17 +60,17 @@ class CommandMSDel : public Command
if (!(ci = cs_findchan(chan)))
{
source.Reply(CHAN_X_NOT_REGISTERED, chan.c_str());
source.Reply(LanguageString::CHAN_X_NOT_REGISTERED, chan.c_str());
return MOD_CONT;
}
else if (readonly)
{
source.Reply(READ_ONLY_MODE);
source.Reply(LanguageString::READ_ONLY_MODE);
return MOD_CONT;
}
else if (!check_access(u, ci, CA_MEMO))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
mi = &ci->memos;
@@ -82,9 +82,9 @@ class CommandMSDel : public Command
else if (mi->memos.empty())
{
if (!chan.empty())
source.Reply(MEMO_X_HAS_NO_MEMOS, chan.c_str());
source.Reply(LanguageString::MEMO_X_HAS_NO_MEMOS, chan.c_str());
else
source.Reply(MEMO_HAVE_NO_MEMOS);
source.Reply(LanguageString::MEMO_HAVE_NO_MEMOS);
}
else
{
@@ -101,7 +101,7 @@ class CommandMSDel : public Command
else
FOREACH_MOD(I_OnMemoDel, OnMemoDel(u->Account(), mi, mi->memos[mi->memos.size() - 1]));
mi->Del(mi->memos[mi->memos.size() - 1]);
source.Reply(MEMO_DELETED_ONE, mi->memos.size() + 1);
source.Reply(_("Memo %d has been deleted."), mi->memos.size() + 1);
}
else
{
@@ -114,9 +114,9 @@ class CommandMSDel : public Command
delete mi->memos[i];
mi->memos.clear();
if (!chan.empty())
source.Reply(MEMO_CHAN_DELETED_ALL, chan.c_str());
source.Reply(_("All memos for channel %s have been deleted."), chan.c_str());
else
source.Reply(MEMO_DELETED_ALL);
source.Reply(_("All of your memos have been deleted."));
}
}
return MOD_CONT;
@@ -124,18 +124,33 @@ class CommandMSDel : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(MEMO_HELP_DEL);
source.Reply(_("Syntax: \002DEL [\037channel\037] {\037num\037 | \037list\037 | LAST | ALL}\002\n"
" \n"
"Deletes the specified memo or memos. You can supply\n"
"multiple memo numbers or ranges of numbers instead of a\n"
"single number, as in the second example below.\n"
" \n"
"If \002LAST\002 is given, the last memo will be deleted.\n"
"If \002ALL\002 is given, deletes all of your memos.\n"
" \n"
"Examples:\n"
" \n"
" \002DEL 1\002\n"
" Deletes your first memo.\n"
" \n"
" \002DEL 2-5,7-9\002\n"
" Deletes memos numbered 2 through 5 and 7 through 9."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "DEL", MEMO_DEL_SYNTAX);
SyntaxError(source, "DEL", _("DEL [\037channel\037] {\037num\037 | \037list\037 | ALL}"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(MEMO_HELP_CMD_DEL);
source.Reply(_(" DEL Delete a memo or memos"));
}
};
+11 -2
View File
@@ -30,11 +30,20 @@ class CommandMSHelp : public Command
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
User *u = source.u;
source.Reply(MEMO_HELP_HEADER);
source.Reply(_("\002%S\002 is a utility allowing IRC users to send short\n"
"messages to other IRC users, whether they are online at\n"
"the time or not, or to channels(*). Both the sender's\n"
"nickname and the target nickname or channel must be\n"
"registered in order to send a memo.\n"
"%S's commands include:"));
for (CommandMap::const_iterator it = MemoServ->Commands.begin(), it_end = MemoServ->Commands.end(); it != it_end; ++it)
if (!Config->HidePrivilegedCommands || it->second->permission.empty() || (u->Account() && u->Account()->HasCommand(it->second->permission)))
it->second->OnServHelp(source);
source.Reply(MEMO_HELP_FOOTER, Config->s_ChanServ.c_str());
source.Reply(_("Type \002%R%S HELP \037command\037\002 for help on any of the\n"
"above commands.\n"
"(*) By default, any user with at least level 10 access on a\n"
" channel can read that channel's memos. This can be\n"
" changed with the %s \002LEVELS\002 command."), Config->s_ChanServ.c_str());
}
};
+15 -12
View File
@@ -40,21 +40,21 @@ class CommandMSIgnore : public Command
if (!mi)
{
if (isforbid)
source.Reply(ischan ? CHAN_X_FORBIDDEN : NICK_X_FORBIDDEN, channel.c_str());
source.Reply(ischan ? LanguageString::CHAN_X_FORBIDDEN : LanguageString::NICK_X_FORBIDDEN, channel.c_str());
else
source.Reply(ischan ? CHAN_X_NOT_REGISTERED : NICK_X_NOT_REGISTERED, channel.c_str());
source.Reply(ischan ? LanguageString::CHAN_X_NOT_REGISTERED : LanguageString::NICK_X_NOT_REGISTERED, channel.c_str());
}
else if (ischan && !check_access(u, cs_findchan(channel), CA_MEMO))
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
else if (command.equals_ci("ADD") && !param.empty())
{
if (std::find(mi->ignores.begin(), mi->ignores.end(), param.ci_str()) == mi->ignores.end())
{
mi->ignores.push_back(param.ci_str());
source.Reply(MEMO_IGNORE_ADD, param.c_str());
source.Reply(_("\002%s\002 added to your ignore list."), param.c_str());
}
else
source.Reply(MEMO_IGNORE_ALREADY_IGNORED, param.c_str());
source.Reply(_("\002%s\002 is already on your ignore list."), param.c_str());
}
else if (command.equals_ci("DEL") && !param.empty())
{
@@ -63,18 +63,18 @@ class CommandMSIgnore : public Command
if (it != mi->ignores.end())
{
mi->ignores.erase(it);
source.Reply(MEMO_IGNORE_DEL, param.c_str());
source.Reply(_("\002%s\002 removed from your ignore list."), param.c_str());
}
else
source.Reply(MEMO_IGNORE_NOT_IGNORED, param.c_str());
source.Reply(_("\002%s\002 is not on your ignore list."), param.c_str());
}
else if (command.equals_ci("LIST"))
{
if (mi->ignores.empty())
source.Reply(MEMO_IGNORE_LIST_EMPTY);
source.Reply(_("Your memo ignore list is empty."));
else
{
source.Reply(MEMO_IGNORE_LIST_HEADER);
source.Reply(_("Ignore list:"));
for (unsigned i = 0; i < mi->ignores.size(); ++i)
source.Reply(" %s", mi->ignores[i].c_str());
}
@@ -87,18 +87,21 @@ class CommandMSIgnore : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(MEMO_HELP_IGNORE);
source.Reply(_("Syntax: \002IGNORE [\037channek\037] {\002ADD|DEL|LIST\002} [\037entry\037]\n"
" \n"
"Allows you to ignore users by nick or host from memoing you. If someone on your\n"
"memo ignore list tries to memo you, they will not be told that you have them ignored."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "IGNORE", MEMO_IGNORE_SYNTAX);
SyntaxError(source, "IGNORE", _("IGNORE [\037channel\037] {\002ADD|DEL|\002} [\037entry\037]"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(MEMO_HELP_CMD_IGNORE);
source.Reply(_(" IGNORE Manage your memo ignore list"));
}
};
+55 -40
View File
@@ -35,12 +35,12 @@ class CommandMSInfo : public Command
na = findnick(nname);
if (!na)
{
source.Reply(NICK_X_NOT_REGISTERED, nname.c_str());
source.Reply(LanguageString::NICK_X_NOT_REGISTERED, nname.c_str());
return MOD_CONT;
}
else if (na->HasFlag(NS_FORBIDDEN))
{
source.Reply(NICK_X_FORBIDDEN, nname.c_str());
source.Reply(LanguageString::NICK_X_FORBIDDEN, nname.c_str());
return MOD_CONT;
}
mi = &na->nc->memos;
@@ -50,12 +50,12 @@ class CommandMSInfo : public Command
{
if (!(ci = cs_findchan(nname)))
{
source.Reply(CHAN_X_NOT_REGISTERED, nname.c_str());
source.Reply(LanguageString::CHAN_X_NOT_REGISTERED, nname.c_str());
return MOD_CONT;
}
else if (!check_access(u, ci, CA_MEMO))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
mi = &ci->memos;
@@ -63,7 +63,7 @@ class CommandMSInfo : public Command
}
else if (!nname.empty()) /* It's not a chan and we aren't services admin */
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
else
@@ -75,13 +75,13 @@ class CommandMSInfo : public Command
if (!nname.empty() && (ci || na->nc != u->Account()))
{
if (mi->memos.empty())
source.Reply(MEMO_INFO_X_NO_MEMOS, nname.c_str());
source.Reply(_("%s currently has no memos."), nname.c_str());
else if (mi->memos.size() == 1)
{
if (mi->memos[0]->HasFlag(MF_UNREAD))
source.Reply(MEMO_INFO_X_MEMO_UNREAD, nname.c_str());
source.Reply(_("%s currently has \0021\002 memo, and it has not yet been read."), nname.c_str());
else
source.Reply(MEMO_INFO_X_MEMO, nname.c_str());
source.Reply(_("%s currently has \0021\002 memo."), nname.c_str());
}
else
{
@@ -90,55 +90,55 @@ class CommandMSInfo : public Command
if (mi->memos[i]->HasFlag(MF_UNREAD))
++count;
if (count == mi->memos.size())
source.Reply(MEMO_INFO_X_MEMOS_ALL_UNREAD, nname.c_str(), count);
source.Reply(_("%s currently has \002%d\002 memos; all of them are unread."), nname.c_str(), count);
else if (!count)
source.Reply(MEMO_INFO_X_MEMOS, nname.c_str(), mi->memos.size());
source.Reply(_("%s currently has \002%d\002 memos."), nname.c_str(), mi->memos.size());
else if (count == 1)
source.Reply(MEMO_INFO_X_MEMOS_ONE_UNREAD, nname.c_str(), mi->memos.size());
source.Reply(_("%s currently has \002%d\002 memos, of which \0021\002 is unread."), nname.c_str(), mi->memos.size());
else
source.Reply(MEMO_INFO_X_MEMOS_SOME_UNREAD, nname.c_str(), mi->memos.size(), count);
source.Reply(_("%s currently has \002%d\002 memos, of which \002%d\002 are unread."), nname.c_str(), mi->memos.size(), count);
}
if (!mi->memomax)
{
if (hardmax)
source.Reply(MEMO_INFO_X_HARD_LIMIT, nname.c_str(), mi->memomax);
source.Reply(_("%s's memo limit is \002%d\002, and may not be changed."), nname.c_str(), mi->memomax);
else
source.Reply(MEMO_INFO_X_LIMIT, nname.c_str(), mi->memomax);
source.Reply(_("%s's memo limit is \002%d\002."), nname.c_str(), mi->memomax);
}
else if (mi->memomax > 0)
{
if (hardmax)
source.Reply(MEMO_INFO_X_HARD_LIMIT, nname.c_str(), mi->memomax);
source.Reply(_("%s's memo limit is \002%d\002, and may not be changed."), nname.c_str(), mi->memomax);
else
source.Reply(MEMO_INFO_X_LIMIT, nname.c_str(), mi->memomax);
source.Reply(_("%s's memo limit is \002%d\002."), nname.c_str(), mi->memomax);
}
else
source.Reply(MEMO_INFO_X_NO_LIMIT, nname.c_str());
source.Reply(_("%s has no memo limit."), nname.c_str());
/* I ripped this code out of ircservices 4.4.5, since I didn't want
to rewrite the whole thing (it pisses me off). */
if (na)
{
if (na->nc->HasFlag(NI_MEMO_RECEIVE) && na->nc->HasFlag(NI_MEMO_SIGNON))
source.Reply(MEMO_INFO_X_NOTIFY_ON, nname.c_str());
source.Reply(_("%s is notified of new memos at logon and when they arrive."), nname.c_str());
else if (na->nc->HasFlag(NI_MEMO_RECEIVE))
source.Reply(MEMO_INFO_X_NOTIFY_RECEIVE, nname.c_str());
source.Reply(_("%s is notified when new memos arrive."), nname.c_str());
else if (na->nc->HasFlag(NI_MEMO_SIGNON))
source.Reply(MEMO_INFO_X_NOTIFY_SIGNON, nname.c_str());
source.Reply(_("%s is notified of news memos at logon."), nname.c_str());
else
source.Reply(MEMO_INFO_X_NOTIFY_OFF, nname.c_str());
source.Reply(_("%s is not notified of new memos."), nname.c_str());
}
}
else /* !nname || (!ci || na->nc == u->Account()) */
{
if (mi->memos.empty())
source.Reply(MEMO_INFO_NO_MEMOS);
source.Reply(_("You currently have no memos."));
else if (mi->memos.size() == 1)
{
if (mi->memos[0]->HasFlag(MF_UNREAD))
source.Reply(MEMO_INFO_MEMO_UNREAD);
source.Reply(_("You currently have \0021\002 memo, and it has not yet been read."));
else
source.Reply(MEMO_INFO_MEMO);
source.Reply(_("You currently have \0021\002 memo."));
}
else
{
@@ -147,41 +147,41 @@ class CommandMSInfo : public Command
if (mi->memos[i]->HasFlag(MF_UNREAD))
++count;
if (count == mi->memos.size())
source.Reply(MEMO_INFO_MEMOS_ALL_UNREAD, count);
source.Reply(_("You currently have \002%d\002 memos; all of them are unread."), count);
else if (!count)
source.Reply(MEMO_INFO_MEMOS, mi->memos.size());
source.Reply(_("You currently have \002%d\002 memos."), mi->memos.size());
else if (count == 1)
source.Reply(MEMO_INFO_MEMOS_ONE_UNREAD, mi->memos.size());
source.Reply(_("You currently have \002%d\002 memos, of which \0021\002 is unread."), mi->memos.size());
else
source.Reply(MEMO_INFO_MEMOS_SOME_UNREAD, mi->memos.size(), count);
source.Reply(_("You currently have \002%d\002 memos, of which \002%d\002 are unread."), mi->memos.size(), count);
}
if (!mi->memomax)
{
if (!u->Account()->IsServicesOper() && hardmax)
source.Reply(MEMO_INFO_HARD_LIMIT_ZERO);
source.Reply(_("Your memo limit is \0020\002; you will not receive any new memos. You cannot change this limit."));
else
source.Reply(MEMO_INFO_LIMIT_ZERO);
source.Reply(_("Your memo limit is \0020\002; you will not receive any new memos."));
}
else if (mi->memomax > 0)
{
if (!u->Account()->IsServicesOper() && hardmax)
source.Reply(MEMO_INFO_HARD_LIMIT, mi->memomax);
source.Reply(_("Your memo limit is \002%d\002, and may not be changed."), mi->memomax);
else
source.Reply(MEMO_INFO_LIMIT, mi->memomax);
source.Reply(_("Your memo limit is \002%d\002."), mi->memomax);
}
else
source.Reply(MEMO_INFO_NO_LIMIT);
source.Reply(_("You have no limit on the number of memos you may keep."));
/* Ripped too. But differently because of a seg fault (loughs) */
if (u->Account()->HasFlag(NI_MEMO_RECEIVE) && u->Account()->HasFlag(NI_MEMO_SIGNON))
source.Reply(MEMO_INFO_NOTIFY_ON);
source.Reply(_("You will be notified of new memos at logon and when they arrive."));
else if (u->Account()->HasFlag(NI_MEMO_RECEIVE))
source.Reply(MEMO_INFO_NOTIFY_RECEIVE);
source.Reply(_("You will be notified when new memos arrive."));
else if (u->Account()->HasFlag(NI_MEMO_SIGNON))
source.Reply(MEMO_INFO_NOTIFY_SIGNON);
source.Reply(_("You will be notified of new memos at logon."));
else
source.Reply(MEMO_INFO_NOTIFY_OFF);
source.Reply(_("You will not be notified of new memos."));
}
return MOD_CONT;
}
@@ -190,16 +190,31 @@ class CommandMSInfo : public Command
{
User *u = source.u;
if (u->Account() && u->Account()->IsServicesOper())
source.Reply(MEMO_SERVADMIN_HELP_INFO);
source.Reply(_("Syntax: \002INFO [\037nick\037 | \037channel\037]\002\n"
"Without a parameter, displays information on the number of\n"
"memos you have, how many of them are unread, and how many\n"
"total memos you can receive.\n"
" \n"
"With a channel parameter, displays the same information for\n"
"the given channel.\n"
" \n"
"With a nickname parameter, displays the same information\n"
"for the given nickname. This use limited to \002Services\n"
"admins\002."));
else
source.Reply(MEMO_HELP_INFO);
source.Reply(_("Syntax: \002INFO [\037channel\037]\002\n"
" \n"
"Displays information on the number of memos you have, how\n"
"many of them are unread, and how many total memos you can\n"
"receive. With a parameter, displays the same information\n"
"for the given channel."));
return true;
}
void OnServHelp(CommandSource &source)
{
source.Reply(MEMO_HELP_CMD_INFO);
source.Reply(_(" INFO Displays information about your memos"));
}
};
+23 -16
View File
@@ -33,11 +33,11 @@ class MemoListCallback : public NumberList
{
SentHeader = true;
if (ci)
source.Reply(MEMO_LIST_CHAN_MEMOS, ci->name.c_str(), Config->s_MemoServ.c_str(), ci->name.c_str());
source.Reply(_("Memos for %s. To read, type: \002%R%s READ %s \037num\037\002"), ci->name.c_str(), Config->s_MemoServ.c_str(), ci->name.c_str());
else
source.Reply(MEMO_LIST_MEMOS, source.u->nick.c_str(), Config->s_MemoServ.c_str());
source.Reply(_("Memos for %s. To read, type: \002%R%s READ \037num\037\002"), source.u->nick.c_str(), Config->s_MemoServ.c_str());
source.Reply(MEMO_LIST_HEADER);
source.Reply(_(" Num Sender Date/Time"));
}
DoList(source, mi, Number - 1);
@@ -46,7 +46,7 @@ class MemoListCallback : public NumberList
static void DoList(CommandSource &source, const MemoInfo *mi, unsigned index)
{
Memo *m = mi->memos[index];
source.Reply(MEMO_LIST_FORMAT, (m->HasFlag(MF_UNREAD)) ? '*' : ' ', index + 1, m->sender.c_str(), do_strftime(m->time).c_str());
source.Reply(_("%c%3d %-16s %s"), (m->HasFlag(MF_UNREAD)) ? '*' : ' ', index + 1, m->sender.c_str(), do_strftime(m->time).c_str());
}
};
@@ -73,12 +73,12 @@ class CommandMSList : public Command
if (!(ci = cs_findchan(chan)))
{
source.Reply(CHAN_X_NOT_REGISTERED, chan.c_str());
source.Reply(LanguageString::CHAN_X_NOT_REGISTERED, chan.c_str());
return MOD_CONT;
}
else if (!check_access(u, ci, CA_MEMO))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
mi = &ci->memos;
@@ -90,9 +90,9 @@ class CommandMSList : public Command
else if (!mi->memos.size())
{
if (!chan.empty())
source.Reply(MEMO_X_HAS_NO_MEMOS, chan.c_str());
source.Reply(LanguageString::MEMO_X_HAS_NO_MEMOS, chan.c_str());
else
source.Reply(MEMO_HAVE_NO_MEMOS);
source.Reply(LanguageString::MEMO_HAVE_NO_MEMOS);
}
else
{
@@ -111,9 +111,9 @@ class CommandMSList : public Command
if (i == end)
{
if (!chan.empty())
source.Reply(MEMO_X_HAS_NO_NEW_MEMOS, chan.c_str());
source.Reply(LanguageString::MEMO_X_HAS_NO_NEW_MEMOS, chan.c_str());
else
source.Reply(MEMO_HAVE_NO_NEW_MEMOS);
source.Reply(LanguageString::MEMO_HAVE_NO_NEW_MEMOS);
return MOD_CONT;
}
}
@@ -129,10 +129,10 @@ class CommandMSList : public Command
{
SentHeader = true;
if (ci)
source.Reply(!param.empty() ? MEMO_LIST_CHAN_NEW_MEMOS : MEMO_LIST_CHAN_MEMOS, ci->name.c_str(), Config->s_MemoServ.c_str(), ci->name.c_str());
source.Reply(!param.empty() ? _("New memos for %s. To read, type: \002%R%s READ %s \037num\037\002") : _("Memos for %s. To read, type: \002%R%s READ %s \037num\037\002"), ci->name.c_str(), Config->s_MemoServ.c_str(), ci->name.c_str());
else
source.Reply(!param.empty() ? MEMO_LIST_NEW_MEMOS : MEMO_LIST_MEMOS, u->nick.c_str(), Config->s_MemoServ.c_str());
source.Reply(MEMO_LIST_HEADER);
source.Reply(!param.empty() ? _("New memos for %s. To read, type: \002%R%s READ \037num\037\002") : _("Memos for %s. To read, type: \002%R%s READ \037num\037\002"), u->nick.c_str(), Config->s_MemoServ.c_str());
source.Reply(_(" Num Sender Date/Time"));
}
MemoListCallback::DoList(source, mi, i);
@@ -144,18 +144,25 @@ class CommandMSList : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(MEMO_HELP_LIST);
source.Reply(_("Syntax: \002LIST [\037channel\037] [\037list\037 | NEW]\002\n"
" \n"
"Lists any memos you currently have. With \002NEW\002, lists only\n"
"new (unread) memos. Unread memos are marked with a \"*\"\n"
"to the left of the memo number. You can also specify a list\n"
"of numbers, as in the example below:\n"
" \002LIST 2-5,7-9\002\n"
" Lists memos numbered 2 through 5 and 7 through 9."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "LIST", MEMO_LIST_SYNTAX);
SyntaxError(source, "LIST", _("LIST [\037channel\037] [\037list\037 | NEW]"));
}
void OnServCommand(CommandSource &source)
{
source.Reply(MEMO_HELP_CMD_LIST);
source.Reply(_(" LIST List your memos"));
}
};
+21 -12
View File
@@ -34,10 +34,10 @@ class MemoListCallback : public NumberList
{
Memo *m = mi->memos[index];
if (ci)
source.Reply(MEMO_CHAN_HEADER, index + 1, m->sender.c_str(), do_strftime(m->time).c_str(), Config->s_MemoServ.c_str(), ci->name.c_str(), index + 1);
source.Reply(_("Memo %d from %s (%s). To delete, type: \002%R%s DEL %s %d\002"), index + 1, m->sender.c_str(), do_strftime(m->time).c_str(), Config->s_MemoServ.c_str(), ci->name.c_str(), index + 1);
else
source.Reply(MEMO_HEADER, index + 1, m->sender.c_str(), do_strftime(m->time).c_str(), Config->s_MemoServ.c_str(), index + 1);
source.Reply(MEMO_TEXT, m->text.c_str());
source.Reply(_("Memo %d from %s (%s). To delete, type: \002%R%s DEL %d\002"), index + 1, m->sender.c_str(), do_strftime(m->time).c_str(), Config->s_MemoServ.c_str(), index + 1);
source.Reply("%s", m->text.c_str());
m->UnsetFlag(MF_UNREAD);
/* Check if a receipt notification was requested */
@@ -68,12 +68,12 @@ class CommandMSRead : public Command
if (!(ci = cs_findchan(chan)))
{
source.Reply(CHAN_X_NOT_REGISTERED, chan.c_str());
source.Reply(LanguageString::CHAN_X_NOT_REGISTERED, chan.c_str());
return MOD_CONT;
}
else if (!check_access(u, ci, CA_MEMO))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
mi = &ci->memos;
@@ -86,9 +86,9 @@ class CommandMSRead : public Command
else if (mi->memos.empty())
{
if (!chan.empty())
source.Reply(MEMO_X_HAS_NO_MEMOS, chan.c_str());
source.Reply(LanguageString::MEMO_X_HAS_NO_MEMOS, chan.c_str());
else
source.Reply(MEMO_HAVE_NO_MEMOS);
source.Reply(LanguageString::MEMO_HAVE_NO_MEMOS);
}
else
{
@@ -106,9 +106,9 @@ class CommandMSRead : public Command
if (!readcount)
{
if (!chan.empty())
source.Reply(MEMO_X_HAS_NO_NEW_MEMOS, chan.c_str());
source.Reply(LanguageString::MEMO_X_HAS_NO_NEW_MEMOS, chan.c_str());
else
source.Reply(MEMO_HAVE_NO_NEW_MEMOS);
source.Reply(LanguageString::MEMO_HAVE_NO_NEW_MEMOS);
}
}
else if (numstr.equals_ci("LAST"))
@@ -127,18 +127,27 @@ class CommandMSRead : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(MEMO_HELP_READ);
source.Reply(_("Syntax: \002READ [\037channel\037] {\037num\037 | \037list\037 | LAST | NEW}\002\n"
" \n"
"Sends you the text of the memos specified. If LAST is\n"
"given, sends you the memo you most recently received. If\n"
"NEW is given, sends you all of your new memos. Otherwise,\n"
"sends you memo number \037num\037. You can also give a list of\n"
"numbers, as in this example:\n"
" \n"
" \002READ 2-5,7-9\002\n"
" Displays memos numbered 2 through 5 and 7 through 9."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "READ", MEMO_READ_SYNTAX);
SyntaxError(source, "READ", _("READ [\037channel\037] {\037list\037 | LAST | NEW}"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(MEMO_HELP_CMD_READ);
source.Reply(_(" READ Read a memo or memos"));
}
};
+14 -6
View File
@@ -31,7 +31,7 @@ class CommandMSRSend : public Command
/* prevent user from rsend to themselves */
if ((na = findnick(nick)) && na->nc == u->Account())
{
source.Reply(MEMO_NO_RSEND_SELF);
source.Reply(_("You can not request a receipt when sending a memo to yourself."));
return MOD_CONT;
}
@@ -41,7 +41,7 @@ class CommandMSRSend : public Command
if (u->Account()->IsServicesOper())
memo_send(source, nick, text, 3);
else
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
}
else if (Config->MSMemoReceipt == 2)
/* Everybody can use rsend */
@@ -50,7 +50,7 @@ class CommandMSRSend : public Command
{
/* rsend has been disabled */
Log() << "MSMemoReceipt is set misconfigured to " << Config->MSMemoReceipt;
source.Reply(MEMO_RSEND_DISABLED);
source.Reply(_("Sorry, RSEND has been disabled on this network."));
}
return MOD_CONT;
@@ -58,18 +58,26 @@ class CommandMSRSend : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(MEMO_HELP_RSEND);
source.Reply(_("Syntax: \002RSEND {\037nick\037 | \037channel\037} \037memo-text\037\002\n"
" \n"
"Sends the named \037nick\037 or \037channel\037 a memo containing\n"
"\037memo-text\037. When sending to a nickname, the recipient will\n"
"receive a notice that he/she has a new memo. The target\n"
"nickname/channel must be registered.\n"
"Once the memo is read by its recipient, an automatic notification\n"
"memo will be sent to the sender informing him/her that the memo\n"
"has been read."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "RSEND", MEMO_RSEND_SYNTAX);
SyntaxError(source, "RSEND", _("RSEND {\037nick\037 | \037channel\037} \037memo-text\037"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(MEMO_HELP_CMD_RSEND);
source.Reply(_(" RSEND Sends a memo and requests a read receipt"));
}
};
+8 -3
View File
@@ -30,18 +30,23 @@ class CommandMSSend : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(MEMO_HELP_SEND);
source.Reply(_("Syntax: \002SEND {\037nick\037 | \037channel\037} \037memo-text\037\002\n"
" \n"
"Sends the named \037nick\037 or \037channel\037 a memo containing\n"
"\037memo-text\037. When sending to a nickname, the recipient will\n"
"receive a notice that he/she has a new memo. The target\n"
"nickname/channel must be registered."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "SEND", MEMO_SEND_SYNTAX);
SyntaxError(source, "SEND", LanguageString::MEMO_SEND_SYNTAX);
}
void OnServHelp(CommandSource &source)
{
source.Reply(MEMO_HELP_CMD_SEND);
source.Reply(_(" SEND Send a memo to a nick or channel"));
}
};
+6 -5
View File
@@ -27,7 +27,7 @@ class CommandMSSendAll : public Command
if (readonly)
{
source.Reply(MEMO_SEND_DISABLED);
source.Reply(LanguageString::MEMO_SEND_DISABLED);
return MOD_CONT;
}
@@ -41,24 +41,25 @@ class CommandMSSendAll : public Command
memo_send(source, nc->display, text, 1);
}
source.Reply(MEMO_MASS_SENT);
source.Reply(_("A massmemo has been sent to all registered users."));
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(MEMO_HELP_SENDALL);
source.Reply(_("Syntax: \002SENDALL\002 \002memo-text\002\n \n"
"Sends all registered users a memo containing \037memo-text\037."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "SENDALL", MEMO_SENDALL_SYNTAX);
SyntaxError(source, "SENDALL", _("SENDALL \037memo-text\037"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(MEMO_HELP_CMD_SENDALL);
source.Reply(_(" SENDALL Send a memo to all registered users"));
}
};
+81 -40
View File
@@ -25,44 +25,44 @@ class CommandMSSet : public Command
{
u->Account()->SetFlag(NI_MEMO_SIGNON);
u->Account()->SetFlag(NI_MEMO_RECEIVE);
source.Reply(MEMO_SET_NOTIFY_ON, Config->s_MemoServ.c_str());
source.Reply(_("%s will now notify you of memos when you log on and when they are sent to you."), Config->s_MemoServ.c_str());
}
else if (param.equals_ci("LOGON"))
{
u->Account()->SetFlag(NI_MEMO_SIGNON);
u->Account()->UnsetFlag(NI_MEMO_RECEIVE);
source.Reply(MEMO_SET_NOTIFY_LOGON, Config->s_MemoServ.c_str());
source.Reply(_("%s will now notify you of memos when you log on or unset /AWAY."), Config->s_MemoServ.c_str());
}
else if (param.equals_ci("NEW"))
{
u->Account()->UnsetFlag(NI_MEMO_SIGNON);
u->Account()->SetFlag(NI_MEMO_RECEIVE);
source.Reply(MEMO_SET_NOTIFY_NEW, Config->s_MemoServ.c_str());
source.Reply(_("%s will now notify you of memos when they are sent to you."), Config->s_MemoServ.c_str());
}
else if (param.equals_ci("MAIL"))
{
if (!u->Account()->email.empty())
{
u->Account()->SetFlag(NI_MEMO_MAIL);
source.Reply(MEMO_SET_NOTIFY_MAIL);
source.Reply(_("You will now be informed about new memos via email."));
}
else
source.Reply(MEMO_SET_NOTIFY_INVALIDMAIL);
source.Reply(_("There's no email address set for your nick."));
}
else if (param.equals_ci("NOMAIL"))
{
u->Account()->UnsetFlag(NI_MEMO_MAIL);
source.Reply(MEMO_SET_NOTIFY_NOMAIL);
source.Reply(_("You will no longer be informed via email."));
}
else if (param.equals_ci("OFF"))
{
u->Account()->UnsetFlag(NI_MEMO_SIGNON);
u->Account()->UnsetFlag(NI_MEMO_RECEIVE);
u->Account()->UnsetFlag(NI_MEMO_MAIL);
source.Reply(MEMO_SET_NOTIFY_OFF, Config->s_MemoServ.c_str());
source.Reply(_("%s will not send you any notification of memos."), Config->s_MemoServ.c_str());
}
else
SyntaxError(source, "SET NOTIFY", MEMO_SET_NOTIFY_SYNTAX);
SyntaxError(source, "SET NOTIFY", _("SET NOTIFY {ON | LOGON | NEW | MAIL | NOMAIL | OFF }"));
return MOD_CONT;
}
@@ -88,12 +88,12 @@ class CommandMSSet : public Command
p3 = params.size() > 4 ? params[4] : "";
if (!(ci = cs_findchan(chan)))
{
source.Reply(CHAN_X_NOT_REGISTERED, chan.c_str());
source.Reply(LanguageString::CHAN_X_NOT_REGISTERED, chan.c_str());
return MOD_CONT;
}
else if (!is_servadmin && !check_access(u, ci, CA_MEMO))
{
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
return MOD_CONT;
}
mi = &ci->memos;
@@ -105,7 +105,7 @@ class CommandMSSet : public Command
NickAlias *na;
if (!(na = findnick(p1)))
{
source.Reply(NICK_X_NOT_REGISTERED, p1.c_str());
source.Reply(LanguageString::NICK_X_NOT_REGISTERED, p1.c_str());
return MOD_CONT;
}
user = p1;
@@ -114,14 +114,9 @@ class CommandMSSet : public Command
p1 = p2;
p2 = p3;
}
else if (p1.empty())
else if (p1.empty() || (!isdigit(p1[0]) && !p1.equals_ci("NONE")) || (!p2.empty() && !p2.equals_ci("HARD")))
{
SyntaxError(source, "SET LIMIT", MEMO_SET_LIMIT_SERVADMIN_SYNTAX);
return MOD_CONT;
}
if ((!isdigit(p1[0]) && !p1.equals_ci("NONE")) || (!p2.empty() && !p2.equals_ci("HARD")))
{
SyntaxError(source, "SET LIMIT", MEMO_SET_LIMIT_SERVADMIN_SYNTAX);
SyntaxError(source, "SET LIMIT", _("SET LIMIT [\037user\037 | \037channel\037] {\037limit\037 | NONE} [HARD]"));
return MOD_CONT;
}
if (!chan.empty())
@@ -141,7 +136,7 @@ class CommandMSSet : public Command
limit = p1.is_pos_number_only() ? convertTo<int32>(p1) : -1;
if (limit < 0 || limit > 32767)
{
source.Reply(MEMO_SET_LIMIT_OVERFLOW, 32767);
source.Reply(_("Memo limit too large; limiting to %d instead."), 32767);
limit = 32767;
}
if (p1.equals_ci("NONE"))
@@ -151,17 +146,17 @@ class CommandMSSet : public Command
{
if (p1.empty() || !p2.empty() || !isdigit(p1[0]))
{
SyntaxError(source, "SET LIMIT", MEMO_SET_LIMIT_SYNTAX);
SyntaxError(source, "SET LIMIT", _("SET LIMIT [\037channel\037] \037limit\037"));
return MOD_CONT;
}
if (!chan.empty() && ci->HasFlag(CI_MEMO_HARDMAX))
{
source.Reply(MEMO_SET_LIMIT_FORBIDDEN, chan.c_str());
source.Reply(_("The memo limit for %s may not be changed."), chan.c_str());
return MOD_CONT;
}
else if (chan.empty() && nc->HasFlag(NI_MEMO_HARDMAX))
{
source.Reply(MEMO_SET_YOUR_LIMIT_FORBIDDEN);
source.Reply(_("You are not permitted to change your memo limit."));
return MOD_CONT;
}
limit = p1.is_pos_number_only() ? convertTo<int32>(p1) : -1;
@@ -170,14 +165,14 @@ class CommandMSSet : public Command
if (limit < 0 || (Config->MSMaxMemos > 0 && static_cast<unsigned>(limit) > Config->MSMaxMemos))
{
if (!chan.empty())
source.Reply(MEMO_SET_LIMIT_TOO_HIGH, chan.c_str(), Config->MSMaxMemos);
source.Reply(_("You cannot set the memo limit for %s higher than %d."), chan.c_str(), Config->MSMaxMemos);
else
source.Reply(MEMO_SET_YOUR_LIMIT_TOO_HIGH, Config->MSMaxMemos);
source.Reply(_("You cannot set your memo limit higher than %d."), Config->MSMaxMemos);
return MOD_CONT;
}
else if (limit > 32767)
{
source.Reply(MEMO_SET_LIMIT_OVERFLOW, 32767);
source.Reply(_("Memo limit too large; limiting to %d instead."), 32767);
limit = 32767;
}
}
@@ -185,23 +180,23 @@ class CommandMSSet : public Command
if (limit > 0)
{
if (chan.empty() && nc == u->Account())
source.Reply(MEMO_SET_YOUR_LIMIT, limit);
source.Reply(_("Your memo limit has been set to \002%d\002."), limit);
else
source.Reply(MEMO_SET_LIMIT, !chan.empty() ? chan.c_str() : user.c_str(), limit);
source.Reply(_("Memo limit for %s set to \002%d\002."), !chan.empty() ? chan.c_str() : user.c_str(), limit);
}
else if (!limit)
{
if (chan.empty() && nc == u->Account())
source.Reply(MEMO_SET_YOUR_LIMIT_ZERO);
source.Reply(_("You will no longer be able to receive memos."));
else
source.Reply(MEMO_SET_LIMIT_ZERO, !chan.empty() ? chan.c_str() : user.c_str());
source.Reply(_("Memo limit for %s set to \0020\002."), !chan.empty() ? chan.c_str() : user.c_str());
}
else
{
if (chan.empty() && nc == u->Account())
source.Reply(MEMO_UNSET_YOUR_LIMIT);
source.Reply(_("Your memo limit has been disabled."));
else
source.Reply(MEMO_UNSET_LIMIT, !chan.empty() ? chan.c_str() : user.c_str());
source.Reply(_("Memo limit \002disabled\002 for %s."), !chan.empty() ? chan.c_str() : user.c_str());
}
return MOD_CONT;
}
@@ -217,15 +212,15 @@ class CommandMSSet : public Command
MemoInfo *mi = &u->Account()->memos;
if (readonly)
source.Reply(MEMO_SET_DISABLED);
source.Reply(_("Sorry, memo option setting is temporarily disabled."));
else if (cmd.equals_ci("NOTIFY"))
return this->DoNotify(source, params, mi);
else if (cmd.equals_ci("LIMIT"))
return this->DoLimit(source, params, mi);
else
{
source.Reply(NICK_SET_UNKNOWN_OPTION, cmd.c_str());
source.Reply(MORE_INFO, Config->s_MemoServ.c_str(), "SET");
source.Reply(LanguageString::NICK_SET_UNKNOWN_OPTION, cmd.c_str());
source.Reply(LanguageString::MORE_INFO, Config->s_MemoServ.c_str(), "SET");
}
return MOD_CONT;
@@ -234,16 +229,62 @@ class CommandMSSet : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
if (subcommand.empty())
source.Reply(MEMO_HELP_SET);
source.Reply(_("Syntax: \002SET \037option\037 \037parameters\037\002\n \n"
"Sets various memo options. \037option\037 can be one of:\n"
" \n"
" NOTIFY Changes when you will be notified about\n"
" new memos (only for nicknames)\n"
" LIMIT Sets the maximum number of memos you can\n"
" receive\n"
" \n"
"Type \002%R%S HELP SET \037option\037\002 for more information\n"
"on a specific option."));
else if (subcommand.equals_ci("NOTIFY"))
source.Reply(MEMO_HELP_SET_NOTIFY);
source.Reply(_("Syntax: \002SET NOTIFY {ON | LOGON | NEW | MAIL | NOMAIL | OFF}\002\n"
"Changes when you will be notified about new memos:\n"
" \n"
" ON You will be notified of memos when you log on,\n"
" when you unset /AWAY, and when they are sent\n"
" to you.\n"
" LOGON You will only be notified of memos when you log\n"
" on or when you unset /AWAY.\n"
" NEW You will only be notified of memos when they\n"
" are sent to you.\n"
" MAIL You will be notified of memos by email aswell as\n"
" any other settings you have.\n"
" NOMAIL You will not be notified of memos by email.\n"
" OFF You will not receive any notification of memos.\n"
" \n"
"\002ON\002 is essentially \002LOGON\002 and \002NEW\002 combined."));
else if (subcommand.equals_ci("LIMIT"))
{
User *u = source.u;
if (u->Account() && u->Account()->IsServicesOper())
source.Reply(MEMO_SERVADMIN_HELP_SET_LIMIT, Config->MSMaxMemos);
source.Reply(_("Syntax: \002SET LIMIT [\037user\037 | \037channel\037] {\037limit\037 | NONE} [HARD]\002\n"
" \n"
"Sets the maximum number of memos a user or channel is\n"
"allowed to have. Setting the limit to 0 prevents the user\n"
"from receiving any memos; setting it to \002NONE\002 allows the\n"
"user to receive and keep as many memos as they want. If\n"
"you do not give a nickname or channel, your own limit is\n"
"set.\n"
" \n"
"Adding \002HARD\002 prevents the user from changing the limit. Not\n"
"adding \002HARD\002 has the opposite effect, allowing the user to\n"
"change the limit (even if a previous limit was set with\n"
"\002HARD\002).\n"
"This use of the \002SET LIMIT\002 command is limited to \002Services\002\n"
"\002admins\002. Other users may only enter a limit for themselves\n"
"or a channel on which they have such privileges, may not\n"
"remove their limit, may not set a limit above %d, and may\n"
"not set a hard limit."), Config->MSMaxMemos);
else
source.Reply(MEMO_HELP_SET_LIMIT, Config->MSMaxMemos);
source.Reply(_("Syntax: \002SET LIMIT [\037channel\037] \037limit\037\002\n"
" \n"
"Sets the maximum number of memos you (or the given channel)\n"
"are allowed to have. If you set this to 0, no one will be\n"
"able to send any memos to you. However, you cannot set\n"
"this any higher than %d."), Config->MSMaxMemos);
}
else
return false;
@@ -253,12 +294,12 @@ class CommandMSSet : public Command
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "SET", NICK_SET_SYNTAX);
SyntaxError(source, "SET", LanguageString::NICK_SET_SYNTAX);
}
void OnServHelp(CommandSource &source)
{
source.Reply(MEMO_HELP_CMD_SET);
source.Reply(_(" SET Set options related to memos"));
}
};
+7 -4
View File
@@ -26,7 +26,7 @@ class CommandMSStaff : public Command
if (readonly)
{
source.Reply(MEMO_SEND_DISABLED);
source.Reply(LanguageString::MEMO_SEND_DISABLED);
return MOD_CONT;
}
@@ -43,18 +43,21 @@ class CommandMSStaff : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
source.Reply(MEMO_HELP_STAFF);
source.Reply(_("Syntax: \002STAFF\002 \002memo-text\002\n"
" \n"
"Sends all services staff a memo containing \037memo-text\037."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "STAFF", MEMO_STAFF_SYNTAX);
SyntaxError(source, "STAFF", _("STAFF \037memo-text\037"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(MEMO_HELP_CMD_STAFF);
source.Reply(_(" STAFF Send a memo to all opers/admins"));
}
};

Some files were not shown because too many files have changed in this diff Show More