mirror of
https://github.com/anope/anope.git
synced 2026-06-15 06:34:47 +02:00
Compare commits
71 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 230e85798d | |||
| 9604690e9d | |||
| 01e0cf4868 | |||
| 693eeed762 | |||
| 6e5713d64a | |||
| 249ad3dfea | |||
| b94c3740b9 | |||
| 59ec42f0e6 | |||
| 8a65f116b6 | |||
| 8105607257 | |||
| 601da1141e | |||
| 8c0edef714 | |||
| c3efd9426d | |||
| a386439f86 | |||
| 016a5b3903 | |||
| 60aeb2a71a | |||
| 54ea63df66 | |||
| 01fc3ea22e | |||
| 3388736fab | |||
| 0065a0f405 | |||
| 490f832dc0 | |||
| a44acb6de5 | |||
| 13e5ddf807 | |||
| e42c728ab8 | |||
| 4eec5c5435 | |||
| 2667d9e90c | |||
| f2b66278aa | |||
| 5b7d952626 | |||
| 24375d53e6 | |||
| 88ac47e217 | |||
| 8a1bffba9b | |||
| 01eef7a392 | |||
| 67b76fadca | |||
| 7861712437 | |||
| ccc088d946 | |||
| 4468fe77fa | |||
| e71a9e2894 | |||
| f80bdf06ba | |||
| 2d6033c73f | |||
| 756dc49813 | |||
| aa92559aa0 | |||
| eb12a89b8e | |||
| d4a34308e5 | |||
| aab3a8e5b6 | |||
| c72e12d0a6 | |||
| bce0d629fd | |||
| 7d0dacc86c | |||
| 729aa4ab4a | |||
| 18e9e12261 | |||
| 9d68b29c9e | |||
| a4792412ba | |||
| 8bb83f6b1a | |||
| da99a53dfa | |||
| a9e9ac32a0 | |||
| 05e6df23a2 | |||
| 3f9fc23270 | |||
| cb21c7c1fa | |||
| 4008e64f26 | |||
| 1cf5918574 | |||
| afe87bf693 | |||
| ff1c5adb8b | |||
| c36030c826 | |||
| 33a02b1223 | |||
| 68f4556609 | |||
| 23db58a303 | |||
| ee69dc3105 | |||
| e9243c3fde | |||
| 4cfee23303 | |||
| be3822523b | |||
| 111f81aa95 | |||
| f12e1ad222 |
@@ -15,7 +15,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup MSBuild
|
||||
uses: microsoft/setup-msbuild@v1.3
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Setup Conan
|
||||
uses: turtlebrowser/get-conan@v1.2
|
||||
|
||||
+1
-1
@@ -355,7 +355,7 @@ get_filename_component(ABSOLUTE_LOG_DIR ${LOG_DIR} REALPATH BASE_DIR ${CMAKE_INS
|
||||
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ABSOLUTE_DATA_DIR}/backups\")")
|
||||
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ABSOLUTE_LOG_DIR}\")")
|
||||
if(WIN32)
|
||||
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}\${ABSOLUTE_DATA_DIR}/runtime\")")
|
||||
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ABSOLUTE_DATA_DIR}/runtime\")")
|
||||
endif()
|
||||
# On non-Windows platforms, if RUNGROUP is set, change the permissions of the below directories, as well as the group of the data directory
|
||||
if(NOT WIN32 AND RUNGROUP)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# Only install example.chk and anope.example.conf from this directory
|
||||
# NOTE: I would've had this just find all files in the directory, but that would include files not needed (like this file)
|
||||
set(DATA example.chk anope.example.conf botserv.example.conf hostserv.example.conf modules.example.conf operserv.example.conf chanserv.example.conf global.example.conf memoserv.example.conf nickserv.example.conf chanstats.example.conf irc2sql.example.conf stats.standalone.example.conf)
|
||||
set(DATA cron.example.sh anope.example.conf botserv.example.conf hostserv.example.conf modules.example.conf operserv.example.conf chanserv.example.conf global.example.conf memoserv.example.conf nickserv.example.conf chanstats.example.conf irc2sql.example.conf stats.standalone.example.conf)
|
||||
install(FILES ${DATA}
|
||||
DESTINATION ${CONF_DIR}
|
||||
)
|
||||
|
||||
+4
-28
@@ -265,26 +265,7 @@ serverinfo
|
||||
* - solanum
|
||||
* - unrealircd
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "inspircd"
|
||||
|
||||
/*
|
||||
* Some protocol modules can enforce mode locks server-side. This reduces the spam caused by
|
||||
* services immediately reversing mode changes for locked modes.
|
||||
*
|
||||
* If the protocol module you have loaded does not support this, this setting will have no effect.
|
||||
*/
|
||||
use_server_side_mlock = yes
|
||||
|
||||
/*
|
||||
* Some protocol modules can enforce topic locks server-side. This reduces the spam caused by
|
||||
* services immediately reversing topic changes.
|
||||
*
|
||||
* If the protocol module you have loaded does not support this, this setting will have no effect.
|
||||
*/
|
||||
use_server_side_topiclock = yes
|
||||
}
|
||||
module { name = "inspircd" }
|
||||
|
||||
/*
|
||||
* [REQUIRED] Network Information
|
||||
@@ -421,7 +402,7 @@ options
|
||||
/*
|
||||
* Sets the delay between automatic database updates.
|
||||
*/
|
||||
updatetimeout = 5m
|
||||
updatetimeout = 2m
|
||||
|
||||
/*
|
||||
* Sets the delay between checks for expired nicknames and channels.
|
||||
@@ -530,7 +511,7 @@ options
|
||||
*
|
||||
* Removing .UTF-8 will instead use the default encoding for the language, e.g. iso-8859-1 for western European languages.
|
||||
*/
|
||||
languages = "ca_ES.UTF-8 de_DE.UTF-8 el_GR.UTF-8 es_ES.UTF-8 fr_FR.UTF-8 hu_HU.UTF-8 it_IT.UTF-8 nl_NL.UTF-8 pl_PL.UTF-8 pt_PT.UTF-8 ru_RU.UTF-8 tr_TR.UTF-8"
|
||||
languages = "de_DE.UTF-8 el_GR.UTF-8 es_ES.UTF-8 fr_FR.UTF-8 it_IT.UTF-8 nl_NL.UTF-8 pl_PL.UTF-8 pt_PT.UTF-8 tr_TR.UTF-8"
|
||||
|
||||
/*
|
||||
* Default language that non- and newly-registered nicks will receive messages in.
|
||||
@@ -749,7 +730,7 @@ log
|
||||
*
|
||||
* Available privileges:
|
||||
* botserv/administration - Can view and assign private BotServ bots
|
||||
* botserv/fantasy - Can use fantasy commands without the FANTASIA privilege
|
||||
* botserv/fantasy - Can use fantasy commands without the FANTASY privilege
|
||||
* chanserv/administration - Can modify the settings of any channel (including changing of the owner!)
|
||||
* chanserv/access/list - Can view channel access and akick lists, but not modify them
|
||||
* chanserv/access/modify - Can modify channel access and akick lists, and use /chanserv enforce
|
||||
@@ -1153,11 +1134,6 @@ module
|
||||
* This is only useful with very large databases, with hundreds
|
||||
* of thousands of objects, that have a noticeable delay from
|
||||
* writing databases.
|
||||
*
|
||||
* If your database is large enough cause a noticeable delay when
|
||||
* saving you should consider a more powerful alternative such
|
||||
* as db_sql or db_redis, which incrementally update their
|
||||
* databases asynchronously in real time.
|
||||
*/
|
||||
fork = no
|
||||
}
|
||||
|
||||
@@ -107,10 +107,9 @@ module
|
||||
/*
|
||||
* The length of time before a channel registration expires.
|
||||
*
|
||||
* This directive is optional, but recommended.
|
||||
* If not set, the default is 30 days.
|
||||
* This directive is optional. If not set, the default is never.
|
||||
*/
|
||||
expire = 30d
|
||||
#expire = 90d
|
||||
|
||||
/*
|
||||
* The maximum number of entries on a channel's access list.
|
||||
@@ -392,7 +391,7 @@ privilege
|
||||
}
|
||||
|
||||
/*
|
||||
* FANTASIA privilege.
|
||||
* FANTASY privilege.
|
||||
*
|
||||
* Used by botserv/main and chanserv/xop.
|
||||
*
|
||||
@@ -400,7 +399,7 @@ privilege
|
||||
*/
|
||||
privilege
|
||||
{
|
||||
name = "FANTASIA"
|
||||
name = "FANTASY"
|
||||
desc = _("Allowed to use fantasy commands")
|
||||
rank = 30
|
||||
level = 3
|
||||
@@ -1278,7 +1277,7 @@ module
|
||||
* This directive is optional.
|
||||
* If not set, the default is never.
|
||||
*/
|
||||
expire = 90d
|
||||
suspendexpire = 90d
|
||||
|
||||
/*
|
||||
* Settings to show to non-opers in ChanServ's INFO output.
|
||||
|
||||
@@ -286,6 +286,12 @@ module
|
||||
{
|
||||
name = "ns_cert"
|
||||
|
||||
/*
|
||||
* Should users who are connected with a SSL client certificate have its fingerprint be added to
|
||||
* their account when they register. Defaults to yes.
|
||||
*/
|
||||
automatic = yes
|
||||
|
||||
/*
|
||||
* The maximum number of entries allowed on a nickname's certificate fingerprint list.
|
||||
* The default is 5. This number cannot be set to 0.
|
||||
@@ -500,7 +506,6 @@ command { service = "NickServ"; name = "RESETPASS"; command = "nickserv/resetpas
|
||||
* nickserv/set/email, nickserv/saset/email - Used for setting a users email address.
|
||||
* nickserv/set/keepmodes, nickserv/saset/keepmodes - Configure whether or not services should retain a user's modes across sessions.
|
||||
* nickserv/set/kill, nickserv/saset/kill - Used for configuring nickname protection.
|
||||
* nickserv/set/language, nickserv/saset/language - Used for configuring what language services use.
|
||||
* nickserv/set/message, nickserv/saset/message - Used to configure how services send messages to you.
|
||||
* nickserv/set/neverop, nickserv/saset/neverop - Used to configure whether a user can be added to access lists
|
||||
* nickserv/saset/noexpire - Used for configuring noexpire, which prevents nicks from expiring.
|
||||
@@ -536,9 +541,6 @@ command { service = "NickServ"; name = "SASET KEEPMODES"; command = "nickserv/sa
|
||||
command { service = "NickServ"; name = "SET KILL"; command = "nickserv/set/kill"; }
|
||||
command { service = "NickServ"; name = "SASET KILL"; command = "nickserv/saset/kill"; permission = "nickserv/saset/kill"; }
|
||||
|
||||
command { service = "NickServ"; name = "SET LANGUAGE"; command = "nickserv/set/language"; }
|
||||
command { service = "NickServ"; name = "SASET LANGUAGE"; command = "nickserv/saset/language"; permission = "nickserv/saset/language"; }
|
||||
|
||||
command { service = "NickServ"; name = "SET MESSAGE"; command = "nickserv/set/message"; }
|
||||
command { service = "NickServ"; name = "SASET MESSAGE"; command = "nickserv/saset/message"; permission = "nickserv/saset/message"; }
|
||||
|
||||
@@ -550,6 +552,16 @@ command { service = "NickServ"; name = "SASET NEVEROP"; command = "nickserv/sase
|
||||
|
||||
command { service = "NickServ"; name = "SASET NOEXPIRE"; command = "nickserv/saset/noexpire"; permission = "nickserv/saset/noexpire"; }
|
||||
|
||||
/*
|
||||
* ns_set_language
|
||||
*
|
||||
* Provides the command nickserv/set/language and nickserv/saset/language.
|
||||
*
|
||||
* Allows configuring the language that services uses.
|
||||
*/
|
||||
module { name = "ns_set_language" }
|
||||
command { service = "NickServ"; name = "SET LANGUAGE"; command = "nickserv/set/language"; }
|
||||
command { service = "NickServ"; name = "SASET LANGUAGE"; command = "nickserv/saset/language"; permission = "nickserv/saset/language"; }
|
||||
|
||||
/*
|
||||
* ns_set_misc
|
||||
|
||||
@@ -1,3 +1,33 @@
|
||||
Anope Version 2.1.7
|
||||
-------------------
|
||||
Added importing of akick reasons, forbid reasons, opers and session exceptions to db_atheme.
|
||||
Added support for sending tag messages.
|
||||
Added the ability to look up account information of an authenticated user.
|
||||
Fixed a crash in ns_cert when an IRC user is not present during a nick registration.
|
||||
Fixed a null pointer dereference in the global module.
|
||||
Fixed a rare memory leak in os_akill and os_sxline.
|
||||
Improved the performance of some code that looks up the primary nick from an account.
|
||||
Removed the broken Catalan, Hungarian, and Russian translations.
|
||||
Reworked the protocol interface for sending messages.
|
||||
Updated the Turkish translation.
|
||||
|
||||
Anope Version 2.1.6
|
||||
-------------------
|
||||
Added opportunistic upgrading of TLS fingerprints to more secure algorithms on InspIRCd.
|
||||
Added support for logging out partially connected users on Plexus.
|
||||
Added the account registration time to nickserv/info.
|
||||
Changed ns_cert to automatically add a TLS fingerprint to new accounts if available.
|
||||
Clarified that a non-deprecated encryption module must be loaded.
|
||||
Fixed creating the runtime directory on Windows.
|
||||
Fixed mistakenly allowing badpasslimit to be set to a negative value.
|
||||
Fixed parsing backup TLS fingerprints on InspIRCd.
|
||||
Fixed parsing the flood mode on UnrealIRCd.
|
||||
Fixed parsing the history mode on UnrealIRCd.
|
||||
Fixed various iterator invalidation issues.
|
||||
Partially rewrote the Portuguese translation.
|
||||
Removed some incorrect strings from the Turkish translation.
|
||||
Renamed the --modulesdir option to --moduledir to match the name of other path options.
|
||||
|
||||
Anope Version 2.1.5
|
||||
-------------------
|
||||
Added an example systemd unit file.
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
Anope Version 2.1.7
|
||||
-------------------
|
||||
Moved nickserv/set/language and nickserv/saset/language to the ns_set_language module.
|
||||
Renamed module:expire for the cs_suspend module to suspendexpire.
|
||||
Renamed the FANTASIA privilege to FANTASY.
|
||||
|
||||
Anope Version 2.1.6
|
||||
-------------------
|
||||
Added module:automatic to the ns_cert module (defaults to yes).
|
||||
Removed module:use_server_side_mlock for the protocol modules (now always enabled).
|
||||
Removed module:use_server_side_topiclock for the protocol modules (now always enabled).
|
||||
|
||||
Anope Version 2.1.5
|
||||
-------------------
|
||||
Added the nickserv/drop/override and chanserv/drop/override oper privileges.
|
||||
|
||||
+5
-1
@@ -130,6 +130,8 @@ public:
|
||||
Anope::string language;
|
||||
/* Last time an email was sent to this user */
|
||||
time_t lastmail = 0;
|
||||
/* The time this account was registered */
|
||||
time_t time_registered = Anope::CurTime;
|
||||
MemoInfo memos;
|
||||
std::map<Anope::string, Anope::string> last_modes;
|
||||
|
||||
@@ -143,6 +145,8 @@ public:
|
||||
|
||||
/* Unsaved data */
|
||||
|
||||
/** The display nick for this account. */
|
||||
NickAlias *na = nullptr;
|
||||
/* Number of channels registered by this account */
|
||||
uint16_t channelcount = 0;
|
||||
/* Users online now logged into this account */
|
||||
@@ -161,7 +165,7 @@ public:
|
||||
/** Changes the display for this account
|
||||
* @param na The new display, must be grouped to this account.
|
||||
*/
|
||||
void SetDisplay(const NickAlias *na);
|
||||
void SetDisplay(NickAlias *na);
|
||||
|
||||
/** Checks whether this account is a services oper or not.
|
||||
* @return True if this account is a services oper, false otherwise.
|
||||
|
||||
+14
-7
@@ -601,6 +601,20 @@ namespace Anope
|
||||
/** Expands a module path. */
|
||||
inline auto ExpandModule(const Anope::string &path) { return Expand(ModuleDir, path); }
|
||||
|
||||
/** Formats a CTCP message for sending to a client.
|
||||
* @param name The name of the CTCP.
|
||||
* @param body If present then the body of the CTCP.
|
||||
* @return A formatted CTCP ready to send to a client.
|
||||
*/
|
||||
extern CoreExport Anope::string FormatCTCP(const Anope::string &name, const Anope::string &body = "");
|
||||
|
||||
/** Parses a CTCP message received from a client.
|
||||
* @param text The raw message to parse.
|
||||
* @param name The location to store the name of the CTCP.
|
||||
* @param body The location to store body of the CTCP if one is present.
|
||||
* @return True if the message was a well formed CTCP; otherwise, false.
|
||||
*/
|
||||
extern CoreExport bool ParseCTCP(const Anope::string &text, Anope::string &name, Anope::string &body);
|
||||
}
|
||||
|
||||
/** sepstream allows for splitting token separated lists.
|
||||
@@ -717,9 +731,6 @@ protected:
|
||||
*/
|
||||
Anope::string source;
|
||||
public:
|
||||
/** Default constructor, just uses the error message 'Core threw an exception'.
|
||||
*/
|
||||
CoreException() : err("Core threw an exception"), source("The core") { }
|
||||
/** This constructor can be used to specify an error message before throwing.
|
||||
*/
|
||||
CoreException(const Anope::string &message) : err(message), source("The core") { }
|
||||
@@ -750,10 +761,6 @@ class CoreExport ModuleException
|
||||
: public CoreException
|
||||
{
|
||||
public:
|
||||
/** Default constructor, just uses the error message 'Module threw an exception'.
|
||||
*/
|
||||
ModuleException() : CoreException("Module threw an exception", "A Module") { }
|
||||
|
||||
/** This constructor can be used to specify an error message before throwing.
|
||||
*/
|
||||
ModuleException(const Anope::string &message) : CoreException(message, "A Module") { }
|
||||
|
||||
@@ -194,6 +194,7 @@ public:
|
||||
|
||||
void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override
|
||||
{
|
||||
data.SetType(this->name, Serialize::Data::DT_INT);
|
||||
data[this->name] << true;
|
||||
}
|
||||
|
||||
|
||||
+120
-118
@@ -199,6 +199,8 @@ public:
|
||||
class CoreExport NotImplementedException final
|
||||
: public CoreException
|
||||
{
|
||||
public:
|
||||
NotImplementedException() : CoreException("") { }
|
||||
};
|
||||
|
||||
/** Every module in Anope is actually a class.
|
||||
@@ -288,7 +290,7 @@ public:
|
||||
* @param cu The user, channel, and status of the user being kicked
|
||||
* @param kickmsg The reason for the kick.
|
||||
*/
|
||||
virtual void OnPreUserKicked(const MessageSource &source, ChanUserContainer *cu, const Anope::string &kickmsg) { throw NotImplementedException(); }
|
||||
virtual void OnPreUserKicked(const MessageSource &source, ChanUserContainer *cu, const Anope::string &kickmsg) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a user has been kicked from a channel.
|
||||
* @param source The kicker
|
||||
@@ -297,13 +299,13 @@ public:
|
||||
* @param status The status the kicked user had on the channel before they were kicked
|
||||
* @param kickmsg The reason for the kick.
|
||||
*/
|
||||
virtual void OnUserKicked(const MessageSource &source, User *target, const Anope::string &channel, ChannelStatus &status, const Anope::string &kickmsg) { throw NotImplementedException(); }
|
||||
virtual void OnUserKicked(const MessageSource &source, User *target, const Anope::string &channel, ChannelStatus &status, const Anope::string &kickmsg) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when the configuration is being (re)loaded.
|
||||
* @param conf The config that is being built now and will replace the global Config object
|
||||
* @throws A ConfigException to abort the config (re)loading process.
|
||||
*/
|
||||
virtual void OnReload(Configuration::Conf *conf) { throw NotImplementedException(); }
|
||||
virtual void OnReload(Configuration::Conf *conf) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called before a bot is assigned to a channel.
|
||||
* @param sender The user assigning the bot
|
||||
@@ -311,35 +313,35 @@ public:
|
||||
* @param bi The bot being assigned.
|
||||
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to deny the assign.
|
||||
*/
|
||||
virtual EventReturn OnPreBotAssign(User *sender, ChannelInfo *ci, BotInfo *bi) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnPreBotAssign(User *sender, ChannelInfo *ci, BotInfo *bi) ATTR_NOT_NULL(2, 3, 4) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a bot is assigned ot a channel
|
||||
*/
|
||||
virtual void OnBotAssign(User *sender, ChannelInfo *ci, BotInfo *bi) { throw NotImplementedException(); }
|
||||
virtual void OnBotAssign(User *sender, ChannelInfo *ci, BotInfo *bi) ATTR_NOT_NULL(2, 3, 4) { throw NotImplementedException(); }
|
||||
|
||||
/** Called before a bot is unassigned from a channel.
|
||||
* @param sender The user unassigning the bot
|
||||
* @param ci The channel the bot is being removed from
|
||||
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to deny the unassign.
|
||||
*/
|
||||
virtual EventReturn OnBotUnAssign(User *sender, ChannelInfo *ci) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnBotUnAssign(User *sender, ChannelInfo *ci) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a new user connects to the network.
|
||||
* @param u The connecting user.
|
||||
* @param exempt set to true/is true if the user should be excepted from bans etc
|
||||
*/
|
||||
virtual void OnUserConnect(User *u, bool &exempt) { throw NotImplementedException(); }
|
||||
virtual void OnUserConnect(User *u, bool &exempt) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a new server connects to the network.
|
||||
* @param s The server that has connected to the network
|
||||
*/
|
||||
virtual void OnNewServer(Server *s) { throw NotImplementedException(); }
|
||||
virtual void OnNewServer(Server *s) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called after a user changed the nick
|
||||
* @param u The user.
|
||||
* @param oldnick The old nick of the user
|
||||
*/
|
||||
virtual void OnUserNickChange(User *u, const Anope::string &oldnick) { throw NotImplementedException(); }
|
||||
virtual void OnUserNickChange(User *u, const Anope::string &oldnick) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when someone uses the generic/help command
|
||||
* @param source Command source
|
||||
@@ -360,14 +362,14 @@ public:
|
||||
* @param params The parameters the user is sending
|
||||
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it
|
||||
*/
|
||||
virtual EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called after a command has been executed.
|
||||
* @param source The source of the command
|
||||
* @param command The command the user executed
|
||||
* @param params The parameters the user sent
|
||||
*/
|
||||
virtual void OnPostCommand(CommandSource &source, Command *command, const std::vector<Anope::string> ¶ms) { throw NotImplementedException(); }
|
||||
virtual void OnPostCommand(CommandSource &source, Command *command, const std::vector<Anope::string> ¶ms) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when the databases are saved
|
||||
*/
|
||||
@@ -389,7 +391,7 @@ public:
|
||||
* @param params The params
|
||||
* @return EVENT_STOP to halt processing and not run the command, EVENT_ALLOW to allow the command to be executed
|
||||
*/
|
||||
virtual EventReturn OnBotFantasy(CommandSource &source, Command *c, ChannelInfo *ci, const std::vector<Anope::string> ¶ms) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnBotFantasy(CommandSource &source, Command *c, ChannelInfo *ci, const std::vector<Anope::string> ¶ms) ATTR_NOT_NULL(3, 4) { throw NotImplementedException(); }
|
||||
|
||||
/** Called on fantasy command without access
|
||||
* @param source The source of the command
|
||||
@@ -398,31 +400,31 @@ public:
|
||||
* @param params The params
|
||||
* @return EVENT_STOP to halt processing and not run the command, EVENT_ALLOW to allow the command to be executed
|
||||
*/
|
||||
virtual EventReturn OnBotNoFantasyAccess(CommandSource &source, Command *c, ChannelInfo *ci, const std::vector<Anope::string> ¶ms) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnBotNoFantasyAccess(CommandSource &source, Command *c, ChannelInfo *ci, const std::vector<Anope::string> ¶ms) ATTR_NOT_NULL(3, 4) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a bot places a ban
|
||||
* @param u User being banned
|
||||
* @param ci Channel the ban is placed on
|
||||
* @param mask The mask being banned
|
||||
*/
|
||||
virtual void OnBotBan(User *u, ChannelInfo *ci, const Anope::string &mask) { throw NotImplementedException(); }
|
||||
virtual void OnBotBan(User *u, ChannelInfo *ci, const Anope::string &mask) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called before a badword is added to the badword list
|
||||
* @param ci The channel
|
||||
* @param bw The badword
|
||||
*/
|
||||
virtual void OnBadWordAdd(ChannelInfo *ci, const BadWord *bw) { throw NotImplementedException(); }
|
||||
virtual void OnBadWordAdd(ChannelInfo *ci, const BadWord *bw) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called before a badword is deleted from a channel
|
||||
* @param ci The channel
|
||||
* @param bw The badword
|
||||
*/
|
||||
virtual void OnBadWordDel(ChannelInfo *ci, const BadWord *bw) { throw NotImplementedException(); }
|
||||
virtual void OnBadWordDel(ChannelInfo *ci, const BadWord *bw) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a bot is created or destroyed
|
||||
*/
|
||||
virtual void OnCreateBot(BotInfo *bi) { throw NotImplementedException(); }
|
||||
virtual void OnDelBot(BotInfo *bi) { throw NotImplementedException(); }
|
||||
virtual void OnCreateBot(BotInfo *bi) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
virtual void OnDelBot(BotInfo *bi) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called before a bot kicks a user
|
||||
* @param bi The bot sending the kick
|
||||
@@ -431,13 +433,13 @@ public:
|
||||
* @param reason The reason
|
||||
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it
|
||||
*/
|
||||
virtual EventReturn OnBotKick(BotInfo *bi, Channel *c, User *u, const Anope::string &reason) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnBotKick(BotInfo *bi, Channel *c, User *u, const Anope::string &reason) ATTR_NOT_NULL(2, 3, 4) { throw NotImplementedException(); }
|
||||
|
||||
/** Called before a user parts a channel
|
||||
* @param u The user
|
||||
* @param c The channel
|
||||
*/
|
||||
virtual void OnPrePartChannel(User *u, Channel *c) {}
|
||||
virtual void OnPrePartChannel(User *u, Channel *c) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a user parts a channel
|
||||
* @param u The user
|
||||
@@ -445,14 +447,14 @@ public:
|
||||
* @param channel The channel name
|
||||
* @param msg The part reason
|
||||
*/
|
||||
virtual void OnPartChannel(User *u, Channel *c, const Anope::string &channel, const Anope::string &msg) { throw NotImplementedException(); }
|
||||
virtual void OnPartChannel(User *u, Channel *c, const Anope::string &channel, const Anope::string &msg) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a user leaves a channel.
|
||||
* From either parting, being kicked, or quitting/killed!
|
||||
* @param u The user
|
||||
* @param c The channel
|
||||
*/
|
||||
virtual void OnLeaveChannel(User *u, Channel *c) { throw NotImplementedException(); }
|
||||
virtual void OnLeaveChannel(User *u, Channel *c) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called after a user joins a channel
|
||||
* If this event triggers the user is allowed to be in the channel, and will
|
||||
@@ -461,7 +463,7 @@ public:
|
||||
* @param u The user
|
||||
* @param channel The channel
|
||||
*/
|
||||
virtual void OnJoinChannel(User *u, Channel *c) { throw NotImplementedException(); }
|
||||
virtual void OnJoinChannel(User *u, Channel *c) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a new topic is set
|
||||
* @param source The user changing the topic, if any
|
||||
@@ -469,18 +471,18 @@ public:
|
||||
* @param setter The user who set the new topic, if there is no source
|
||||
* @param topic The new topic
|
||||
*/
|
||||
virtual void OnTopicUpdated(User *source, Channel *c, const Anope::string &user, const Anope::string &topic) { throw NotImplementedException(); }
|
||||
virtual void OnTopicUpdated(User *source, Channel *c, const Anope::string &user, const Anope::string &topic) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called before a channel expires
|
||||
* @param ci The channel
|
||||
* @param expire Set to true to allow the chan to expire
|
||||
*/
|
||||
virtual void OnPreChanExpire(ChannelInfo *ci, bool &expire) { throw NotImplementedException(); }
|
||||
virtual void OnPreChanExpire(ChannelInfo *ci, bool &expire) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called before a channel expires
|
||||
* @param ci The channel
|
||||
*/
|
||||
virtual void OnChanExpire(ChannelInfo *ci) { throw NotImplementedException(); }
|
||||
virtual void OnChanExpire(ChannelInfo *ci) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called before Anope connects to its uplink
|
||||
*/
|
||||
@@ -492,7 +494,7 @@ public:
|
||||
|
||||
/** Called when we are almost done synching with the uplink, just before we send the EOB
|
||||
*/
|
||||
virtual void OnPreUplinkSync(Server *serv) { throw NotImplementedException(); }
|
||||
virtual void OnPreUplinkSync(Server *serv) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when Anope disconnects from its uplink, before it tries to reconnect
|
||||
*/
|
||||
@@ -510,12 +512,12 @@ public:
|
||||
* @param na The nick
|
||||
* @param expire Set to true to allow the nick to expire
|
||||
*/
|
||||
virtual void OnPreNickExpire(NickAlias *na, bool &expire) { throw NotImplementedException(); }
|
||||
virtual void OnPreNickExpire(NickAlias *na, bool &expire) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a nick drops
|
||||
* @param na The nick
|
||||
*/
|
||||
virtual void OnNickExpire(NickAlias *na) { throw NotImplementedException(); }
|
||||
virtual void OnNickExpire(NickAlias *na) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when defcon level changes
|
||||
* @param level The level
|
||||
@@ -526,13 +528,13 @@ public:
|
||||
* @param ex The exception
|
||||
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it
|
||||
*/
|
||||
virtual EventReturn OnExceptionAdd(Exception *ex) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnExceptionAdd(Exception *ex) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called before an exception is deleted
|
||||
* @param source The source deleting it
|
||||
* @param ex The exception
|
||||
*/
|
||||
virtual void OnExceptionDel(CommandSource &source, Exception *ex) { throw NotImplementedException(); }
|
||||
virtual void OnExceptionDel(CommandSource &source, Exception *ex) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called before a XLine is added
|
||||
* @param source The source of the XLine
|
||||
@@ -540,31 +542,31 @@ public:
|
||||
* @param xlm The xline manager it was added to
|
||||
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it
|
||||
*/
|
||||
virtual EventReturn OnAddXLine(CommandSource &source, const XLine *x, XLineManager *xlm) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnAddXLine(CommandSource &source, const XLine *x, XLineManager *xlm) ATTR_NOT_NULL(3, 4) { throw NotImplementedException(); }
|
||||
|
||||
/** Called before a XLine is deleted
|
||||
* @param source The source of the XLine
|
||||
* @param x The XLine
|
||||
* @param xlm The xline manager it was deleted from
|
||||
*/
|
||||
virtual void OnDelXLine(CommandSource &source, const XLine *x, XLineManager *xlm) { throw NotImplementedException(); }
|
||||
virtual void OnDelXLine(CommandSource &source, const XLine *x, XLineManager *xlm) ATTR_NOT_NULL(4) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a user is checked for whether they are a services oper
|
||||
* @param u The user
|
||||
* @return EVENT_ALLOW to allow, anything else to deny
|
||||
*/
|
||||
virtual EventReturn IsServicesOper(User *u) { throw NotImplementedException(); }
|
||||
virtual EventReturn IsServicesOper(User *u) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a server quits
|
||||
* @param server The server
|
||||
*/
|
||||
virtual void OnServerQuit(Server *server) { throw NotImplementedException(); }
|
||||
virtual void OnServerQuit(Server *server) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a user quits, or is killed
|
||||
* @param u The user
|
||||
* @param msg The quit message
|
||||
*/
|
||||
virtual void OnUserQuit(User *u, const Anope::string &msg) { throw NotImplementedException(); }
|
||||
virtual void OnUserQuit(User *u, const Anope::string &msg) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a user is quit, before and after being internally removed from
|
||||
* This is different from OnUserQuit, which takes place at the time of the quit.
|
||||
@@ -572,43 +574,43 @@ public:
|
||||
* all lists (channels, user list, etc)
|
||||
* @param u The user
|
||||
*/
|
||||
virtual void OnPreUserLogoff(User *u) { throw NotImplementedException(); }
|
||||
virtual void OnPostUserLogoff(User *u) { throw NotImplementedException(); }
|
||||
virtual void OnPreUserLogoff(User *u) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
virtual void OnPostUserLogoff(User *u) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a new bot is made
|
||||
* @param bi The bot
|
||||
*/
|
||||
virtual void OnBotCreate(BotInfo *bi) { throw NotImplementedException(); }
|
||||
virtual void OnBotCreate(BotInfo *bi) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a bot is changed
|
||||
* @param bi The bot
|
||||
*/
|
||||
virtual void OnBotChange(BotInfo *bi) { throw NotImplementedException(); }
|
||||
virtual void OnBotChange(BotInfo *bi) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a bot is deleted
|
||||
* @param bi The bot
|
||||
*/
|
||||
virtual void OnBotDelete(BotInfo *bi) { throw NotImplementedException(); }
|
||||
virtual void OnBotDelete(BotInfo *bi) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called after an access entry is deleted from a channel
|
||||
* @param ci The channel
|
||||
* @param source The source of the command
|
||||
* @param access The access entry that was removed
|
||||
*/
|
||||
virtual void OnAccessDel(ChannelInfo *ci, CommandSource &source, ChanAccess *access) { throw NotImplementedException(); }
|
||||
virtual void OnAccessDel(ChannelInfo *ci, CommandSource &source, ChanAccess *access) ATTR_NOT_NULL(2, 4) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when access is added
|
||||
* @param ci The channel
|
||||
* @param source The source of the command
|
||||
* @param access The access changed
|
||||
*/
|
||||
virtual void OnAccessAdd(ChannelInfo *ci, CommandSource &source, ChanAccess *access) { throw NotImplementedException(); }
|
||||
virtual void OnAccessAdd(ChannelInfo *ci, CommandSource &source, ChanAccess *access) ATTR_NOT_NULL(2, 4) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when the access list is cleared
|
||||
* @param ci The channel
|
||||
* @param u The user who cleared the access
|
||||
*/
|
||||
virtual void OnAccessClear(ChannelInfo *ci, CommandSource &source) { throw NotImplementedException(); }
|
||||
virtual void OnAccessClear(ChannelInfo *ci, CommandSource &source) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a level for a channel is changed
|
||||
* @param source The source of the command
|
||||
@@ -616,63 +618,63 @@ public:
|
||||
* @param priv The privilege changed
|
||||
* @param what The new level
|
||||
*/
|
||||
virtual void OnLevelChange(CommandSource &source, ChannelInfo *ci, const Anope::string &priv, int16_t what) { throw NotImplementedException(); }
|
||||
virtual void OnLevelChange(CommandSource &source, ChannelInfo *ci, const Anope::string &priv, int16_t what) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called right before a channel is dropped
|
||||
* @param source The user dropping the channel
|
||||
* @param ci The channel
|
||||
*/
|
||||
virtual EventReturn OnChanDrop(CommandSource &source, ChannelInfo *ci) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnChanDrop(CommandSource &source, ChannelInfo *ci) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a channel is registered
|
||||
* @param ci The channel
|
||||
*/
|
||||
virtual void OnChanRegistered(ChannelInfo *ci) { throw NotImplementedException(); }
|
||||
virtual void OnChanRegistered(ChannelInfo *ci) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a channel is suspended
|
||||
* @param ci The channel
|
||||
*/
|
||||
virtual void OnChanSuspend(ChannelInfo *ci) { throw NotImplementedException(); }
|
||||
virtual void OnChanSuspend(ChannelInfo *ci) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a channel is unsuspended
|
||||
* @param ci The channel
|
||||
*/
|
||||
virtual void OnChanUnsuspend(ChannelInfo *ci) { throw NotImplementedException(); }
|
||||
virtual void OnChanUnsuspend(ChannelInfo *ci) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a channel is being created, for any reason
|
||||
* @param ci The channel
|
||||
*/
|
||||
virtual void OnCreateChan(ChannelInfo *ci) { throw NotImplementedException(); }
|
||||
virtual void OnCreateChan(ChannelInfo *ci) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a channel is being deleted, for any reason
|
||||
* @param ci The channel
|
||||
*/
|
||||
virtual void OnDelChan(ChannelInfo *ci) { throw NotImplementedException(); }
|
||||
virtual void OnDelChan(ChannelInfo *ci) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a new channel is created
|
||||
* Note that this channel may not be introduced to the uplink at this point.
|
||||
* @param c The channel
|
||||
*/
|
||||
virtual void OnChannelCreate(Channel *c) { throw NotImplementedException(); }
|
||||
virtual void OnChannelCreate(Channel *c) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a channel is deleted
|
||||
* @param c The channel
|
||||
*/
|
||||
virtual void OnChannelDelete(Channel *c) { throw NotImplementedException(); }
|
||||
virtual void OnChannelDelete(Channel *c) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called after adding an akick to a channel
|
||||
* @param source The source of the command
|
||||
* @param ci The channel
|
||||
* @param ak The akick
|
||||
*/
|
||||
virtual void OnAkickAdd(CommandSource &source, ChannelInfo *ci, const AutoKick *ak) { throw NotImplementedException(); }
|
||||
virtual void OnAkickAdd(CommandSource &source, ChannelInfo *ci, const AutoKick *ak) ATTR_NOT_NULL(3, 4) { throw NotImplementedException(); }
|
||||
|
||||
/** Called before removing an akick from a channel
|
||||
* @param source The source of the command
|
||||
* @param ci The channel
|
||||
* @param ak The akick
|
||||
*/
|
||||
virtual void OnAkickDel(CommandSource &source, ChannelInfo *ci, const AutoKick *ak) { throw NotImplementedException(); }
|
||||
virtual void OnAkickDel(CommandSource &source, ChannelInfo *ci, const AutoKick *ak) ATTR_NOT_NULL(3, 4) { throw NotImplementedException(); }
|
||||
|
||||
/** Called after a user join a channel when we decide whether to kick them or not
|
||||
* @param u The user
|
||||
@@ -682,7 +684,7 @@ public:
|
||||
* @param reason The reason for the kick
|
||||
* @return EVENT_STOP to prevent the user from joining by kicking/banning the user
|
||||
*/
|
||||
virtual EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a user requests info for a channel
|
||||
* @param source The user requesting info
|
||||
@@ -690,109 +692,109 @@ public:
|
||||
* @param info Data to show the user requesting information
|
||||
* @param show_hidden true if we should show the user everything
|
||||
*/
|
||||
virtual void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_hidden) { throw NotImplementedException(); }
|
||||
virtual void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_hidden) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||
|
||||
/** Checks if access has the channel privilege 'priv'.
|
||||
* @param access THe access struct
|
||||
* @param priv The privilege being checked for
|
||||
* @return EVENT_ALLOW for yes, EVENT_STOP to stop all processing
|
||||
*/
|
||||
virtual EventReturn OnCheckPriv(const ChanAccess *access, const Anope::string &priv) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnCheckPriv(const ChanAccess *access, const Anope::string &priv) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Check whether an access group has a privilege
|
||||
* @param group The group
|
||||
* @param priv The privilege
|
||||
* @return MOD_ALLOW to allow, MOD_STOP to stop
|
||||
*/
|
||||
virtual EventReturn OnGroupCheckPriv(const AccessGroup *group, const Anope::string &priv) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnGroupCheckPriv(const AccessGroup *group, const Anope::string &priv) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a nick is dropped
|
||||
* @param source The source of the command
|
||||
* @param na The nick
|
||||
*/
|
||||
virtual void OnNickDrop(CommandSource &source, NickAlias *na) { throw NotImplementedException(); }
|
||||
virtual void OnNickDrop(CommandSource &source, NickAlias *na) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a user groups their nick
|
||||
* @param u The user grouping
|
||||
* @param target The target they're grouping to
|
||||
*/
|
||||
virtual void OnNickGroup(User *u, NickAlias *target) { throw NotImplementedException(); }
|
||||
virtual void OnNickGroup(User *u, NickAlias *target) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a user identifies to a nick
|
||||
* @param u The user
|
||||
*/
|
||||
virtual void OnNickIdentify(User *u) { throw NotImplementedException(); }
|
||||
virtual void OnNickIdentify(User *u) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a user is logged into an account
|
||||
* @param u The user
|
||||
*/
|
||||
virtual void OnUserLogin(User *u) { throw NotImplementedException(); }
|
||||
virtual void OnUserLogin(User *u) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a nick logs out
|
||||
* @param u The nick
|
||||
*/
|
||||
virtual void OnNickLogout(User *u) { throw NotImplementedException(); }
|
||||
virtual void OnNickLogout(User *u) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a nick is registered
|
||||
* @param user The user registering the nick, of any
|
||||
* @param The nick
|
||||
* @param pass The password of the newly registered nick
|
||||
*/
|
||||
virtual void OnNickRegister(User *user, NickAlias *na, const Anope::string &pass) { throw NotImplementedException(); }
|
||||
virtual void OnNickRegister(User *user, NickAlias *na, const Anope::string &pass) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a nick is confirmed. This will never be called if registration confirmation is not enabled.
|
||||
* @param user The user confirming the nick
|
||||
* @param The account being confirmed
|
||||
* @param nc The account being confirmed
|
||||
*/
|
||||
virtual void OnNickConfirm(User *user, NickCore *) { throw NotImplementedException(); }
|
||||
virtual void OnNickConfirm(User *user, NickCore *nc) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a nick is suspended
|
||||
* @param na The nick alias
|
||||
*/
|
||||
virtual void OnNickSuspend(NickAlias *na) { throw NotImplementedException(); }
|
||||
virtual void OnNickSuspend(NickAlias *na) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a nick is unsuspended
|
||||
* @param na The nick alias
|
||||
*/
|
||||
virtual void OnNickUnsuspended(NickAlias *na) { throw NotImplementedException(); }
|
||||
virtual void OnNickUnsuspended(NickAlias *na) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called on delnick()
|
||||
* @ param na pointer to the nickalias
|
||||
*/
|
||||
virtual void OnDelNick(NickAlias *na) { throw NotImplementedException(); }
|
||||
virtual void OnDelNick(NickAlias *na) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a nickcore is created
|
||||
* @param nc The nickcore
|
||||
*/
|
||||
virtual void OnNickCoreCreate(NickCore *nc) { throw NotImplementedException(); }
|
||||
virtual void OnNickCoreCreate(NickCore *nc) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called on delcore()
|
||||
* @param nc pointer to the NickCore
|
||||
*/
|
||||
virtual void OnDelCore(NickCore *nc) { throw NotImplementedException(); }
|
||||
virtual void OnDelCore(NickCore *nc) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called on change_core_display()
|
||||
* @param nc pointer to the NickCore
|
||||
* @param newdisplay the new display
|
||||
*/
|
||||
virtual void OnChangeCoreDisplay(NickCore *nc, const Anope::string &newdisplay) { throw NotImplementedException(); }
|
||||
virtual void OnChangeCoreDisplay(NickCore *nc, const Anope::string &newdisplay) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** called from NickCore::ClearCert()
|
||||
* @param nc pointer to the NickCore
|
||||
*/
|
||||
virtual void OnNickClearCert(NickCore *nc) { throw NotImplementedException(); }
|
||||
virtual void OnNickClearCert(NickCore *nc) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a user adds an entry to their cert list
|
||||
* @param nc The nick
|
||||
* @param entry The entry
|
||||
*/
|
||||
virtual void OnNickAddCert(NickCore *nc, const Anope::string &entry) { throw NotImplementedException(); }
|
||||
virtual void OnNickAddCert(NickCore *nc, const Anope::string &entry) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called from NickCore::EraseCert()
|
||||
* @param nc pointer to the NickCore
|
||||
* @param entry The fingerprint
|
||||
*/
|
||||
virtual void OnNickEraseCert(NickCore *nc, const Anope::string &entry) { throw NotImplementedException(); }
|
||||
virtual void OnNickEraseCert(NickCore *nc, const Anope::string &entry) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a user requests info for a nick
|
||||
* @param source The user requesting info
|
||||
@@ -800,55 +802,55 @@ public:
|
||||
* @param info Data to show the user requesting information
|
||||
* @param show_hidden true if we should show the user everything
|
||||
*/
|
||||
virtual void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) { throw NotImplementedException(); }
|
||||
virtual void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a user uses botserv/info on a bot or channel.
|
||||
*/
|
||||
virtual void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) { throw NotImplementedException(); }
|
||||
virtual void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) ATTR_NOT_NULL(4) { throw NotImplementedException(); }
|
||||
|
||||
/** Check whether a username and password is correct
|
||||
* @param u The user trying to identify, if applicable.
|
||||
* @param req The login request
|
||||
*/
|
||||
virtual void OnCheckAuthentication(User *u, IdentifyRequest *req) { throw NotImplementedException(); }
|
||||
virtual void OnCheckAuthentication(User *u, IdentifyRequest *req) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a user does /ns update
|
||||
* @param u The user
|
||||
*/
|
||||
virtual void OnNickUpdate(User *u) { throw NotImplementedException(); }
|
||||
virtual void OnNickUpdate(User *u) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when we get informed about a users SSL fingerprint
|
||||
* when we call this, the fingerprint should already be stored in the user struct
|
||||
* @param u pointer to the user
|
||||
*/
|
||||
virtual void OnFingerprint(User *u) { throw NotImplementedException(); }
|
||||
virtual void OnFingerprint(User *u) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a user becomes (un)away
|
||||
* @param message The message, is .empty() if unaway
|
||||
*/
|
||||
virtual void OnUserAway(User *u, const Anope::string &message) { throw NotImplementedException(); }
|
||||
virtual void OnUserAway(User *u, const Anope::string &message) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a user invites one of our users to a channel
|
||||
* @param source The user doing the inviting
|
||||
* @param c The channel the user is inviting to
|
||||
* @param targ The user being invited
|
||||
*/
|
||||
virtual void OnInvite(User *source, Channel *c, User *targ) { throw NotImplementedException(); }
|
||||
virtual void OnInvite(User *source, Channel *c, User *targ) ATTR_NOT_NULL(2, 3, 4) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a vhost is deleted
|
||||
* @param na The nickalias of the vhost
|
||||
*/
|
||||
virtual void OnDeleteVHost(NickAlias *na) { throw NotImplementedException(); }
|
||||
virtual void OnDeleteVHost(NickAlias *na) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a vhost is set
|
||||
* @param na The nickalias of the vhost
|
||||
*/
|
||||
virtual void OnSetVHost(NickAlias *na) { throw NotImplementedException(); }
|
||||
virtual void OnSetVHost(NickAlias *na) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a users host changes
|
||||
* @param u The user
|
||||
*/
|
||||
virtual void OnSetDisplayedHost(User *) { throw NotImplementedException(); }
|
||||
virtual void OnSetDisplayedHost(User *u) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a memo is sent
|
||||
* @param source The source of the memo
|
||||
@@ -856,14 +858,14 @@ public:
|
||||
* @param mi Memo info for target
|
||||
* @param m The memo
|
||||
*/
|
||||
virtual void OnMemoSend(const Anope::string &source, const Anope::string &target, MemoInfo *mi, Memo *m) { throw NotImplementedException(); }
|
||||
virtual void OnMemoSend(const Anope::string &source, const Anope::string &target, MemoInfo *mi, Memo *m) ATTR_NOT_NULL(4, 5) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a memo is deleted
|
||||
* @param target The target the memo is being deleted from (nick or channel)
|
||||
* @param mi The memo info
|
||||
* @param m The memo
|
||||
*/
|
||||
virtual void OnMemoDel(const Anope::string &target, MemoInfo *mi, const Memo *m) { throw NotImplementedException(); }
|
||||
virtual void OnMemoDel(const Anope::string &target, MemoInfo *mi, const Memo *m) ATTR_NOT_NULL(3, 4) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a mode is set on a channel
|
||||
* @param c The channel
|
||||
@@ -872,7 +874,7 @@ public:
|
||||
* @param param The mode param, if there is one
|
||||
* @return EVENT_STOP to make mlock/secureops etc checks not happen
|
||||
*/
|
||||
virtual EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) ATTR_NOT_NULL(2, 4) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a mode is unset on a channel
|
||||
* @param c The channel
|
||||
@@ -881,67 +883,67 @@ public:
|
||||
* @param param The mode param, if there is one
|
||||
* @return EVENT_STOP to make mlock/secureops etc checks not happen
|
||||
*/
|
||||
virtual EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) ATTR_NOT_NULL(2, 4) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a mode is set on a user
|
||||
* @param setter who/what is setting the mode
|
||||
* @param u The user
|
||||
* @param mname The mode name
|
||||
*/
|
||||
virtual void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname) { throw NotImplementedException(); }
|
||||
virtual void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a mode is unset from a user
|
||||
* @param setter who/what is setting the mode
|
||||
* @param u The user
|
||||
* @param mname The mode name
|
||||
*/
|
||||
virtual void OnUserModeUnset(const MessageSource &setter, User *u, const Anope::string &mname) { throw NotImplementedException(); }
|
||||
virtual void OnUserModeUnset(const MessageSource &setter, User *u, const Anope::string &mname) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a channel mode is introduced into Anope
|
||||
* @param cm The mode
|
||||
*/
|
||||
virtual void OnChannelModeAdd(ChannelMode *cm) { throw NotImplementedException(); }
|
||||
virtual void OnChannelModeAdd(ChannelMode *cm) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a user mode is introduced into Anope
|
||||
* @param um The mode
|
||||
*/
|
||||
virtual void OnUserModeAdd(UserMode *um) { throw NotImplementedException(); }
|
||||
virtual void OnUserModeAdd(UserMode *um) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a mode is about to be mlocked
|
||||
* @param ci The channel the mode is being locked on
|
||||
* @param lock The mode lock
|
||||
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to deny the mlock.
|
||||
*/
|
||||
virtual EventReturn OnMLock(ChannelInfo *ci, ModeLock *lock) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnMLock(ChannelInfo *ci, ModeLock *lock) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a mode is about to be unlocked
|
||||
* @param ci The channel the mode is being unlocked from
|
||||
* @param lock The mode lock
|
||||
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to deny the mlock.
|
||||
*/
|
||||
virtual EventReturn OnUnMLock(ChannelInfo *ci, ModeLock *lock) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnUnMLock(ChannelInfo *ci, ModeLock *lock) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called after a module is loaded
|
||||
* @param u The user loading the module, can be NULL
|
||||
* @param m The module
|
||||
*/
|
||||
virtual void OnModuleLoad(User *u, Module *m) { throw NotImplementedException(); }
|
||||
virtual void OnModuleLoad(User *u, Module *m) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called before a module is unloaded
|
||||
* @param u The user, can be NULL
|
||||
* @param m The module
|
||||
*/
|
||||
virtual void OnModuleUnload(User *u, Module *m) { throw NotImplementedException(); }
|
||||
virtual void OnModuleUnload(User *u, Module *m) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a server is synced
|
||||
* @param s The server, can be our uplink server
|
||||
*/
|
||||
virtual void OnServerSync(Server *s) { throw NotImplementedException(); }
|
||||
virtual void OnServerSync(Server *s) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when we sync with our uplink
|
||||
* @param s Our uplink
|
||||
*/
|
||||
virtual void OnUplinkSync(Server *s) { throw NotImplementedException(); }
|
||||
virtual void OnUplinkSync(Server *s) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when we receive a PRIVMSG for one of our clients
|
||||
* @param u The user sending the PRIVMSG
|
||||
@@ -950,7 +952,7 @@ public:
|
||||
* @param tags Message tags
|
||||
* @return EVENT_STOP to halt processing
|
||||
*/
|
||||
virtual EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message, const Anope::map<Anope::string> &tags) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message, const Anope::map<Anope::string> &tags) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when we receive a NOTICE for one of our clients
|
||||
* @param u The user sending the NOTICE
|
||||
@@ -958,7 +960,7 @@ public:
|
||||
* @param tags Message tags
|
||||
* @param message The message
|
||||
*/
|
||||
virtual void OnBotNotice(User *u, BotInfo *bi, Anope::string &message, const Anope::map<Anope::string> &tags) { throw NotImplementedException(); }
|
||||
virtual void OnBotNotice(User *u, BotInfo *bi, Anope::string &message, const Anope::map<Anope::string> &tags) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when we receive a PRIVMSG for a registered channel we are in
|
||||
* @param u The source of the message
|
||||
@@ -966,12 +968,12 @@ public:
|
||||
* @param msg The message
|
||||
* @param tags Message tags
|
||||
*/
|
||||
virtual void OnPrivmsg(User *u, Channel *c, Anope::string &msg, const Anope::map<Anope::string> &tags) { throw NotImplementedException(); }
|
||||
virtual void OnPrivmsg(User *u, Channel *c, Anope::string &msg, const Anope::map<Anope::string> &tags) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a message is logged
|
||||
* @param l The log message
|
||||
*/
|
||||
virtual void OnLog(Log *l) { throw NotImplementedException(); }
|
||||
virtual void OnLog(Log *l) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a log message is actually logged to a given log info
|
||||
* The message has already passed validation checks by the LogInfo
|
||||
@@ -979,13 +981,13 @@ public:
|
||||
* @param l The log message
|
||||
* @param msg The final formatted message, derived from 'l'
|
||||
*/
|
||||
virtual void OnLogMessage(LogInfo *li, const Log *l, const Anope::string &msg) { throw NotImplementedException(); }
|
||||
virtual void OnLogMessage(LogInfo *li, const Log *l, const Anope::string &msg) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a DNS request (question) is received.
|
||||
* @param req The dns request
|
||||
* @param reply The reply that will be sent
|
||||
*/
|
||||
virtual void OnDnsRequest(DNS::Query &req, DNS::Query *reply) { throw NotImplementedException(); }
|
||||
virtual void OnDnsRequest(DNS::Query &req, DNS::Query *reply) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a channels modes are being checked to see if they are allowed,
|
||||
* mostly to ensure mlock/+r are set.
|
||||
@@ -998,7 +1000,7 @@ public:
|
||||
* for a newly created channel to set the correct modes, topic,
|
||||
* set.
|
||||
*/
|
||||
virtual void OnChannelSync(Channel *c) { throw NotImplementedException(); }
|
||||
virtual void OnChannelSync(Channel *c) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called to set the correct modes on the user on the given channel
|
||||
* @param user The user
|
||||
@@ -1007,13 +1009,13 @@ public:
|
||||
* @param give_modes If giving modes is desired
|
||||
* @param take_modes If taking modes is desired
|
||||
*/
|
||||
virtual void OnSetCorrectModes(User *user, Channel *chan, AccessGroup &access, bool &give_modes, bool &take_modes) { throw NotImplementedException(); }
|
||||
virtual void OnSetCorrectModes(User *user, Channel *chan, AccessGroup &access, bool &give_modes, bool &take_modes) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||
|
||||
virtual void OnSerializeCheck(Serialize::Type *) { throw NotImplementedException(); }
|
||||
virtual void OnSerializableConstruct(Serializable *) { throw NotImplementedException(); }
|
||||
virtual void OnSerializableDestruct(Serializable *) { throw NotImplementedException(); }
|
||||
virtual void OnSerializableUpdate(Serializable *) { throw NotImplementedException(); }
|
||||
virtual void OnSerializeTypeCreate(Serialize::Type *) { throw NotImplementedException(); }
|
||||
virtual void OnSerializeCheck(Serialize::Type *st) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
virtual void OnSerializableConstruct(Serializable *st) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
virtual void OnSerializableDestruct(Serializable *st) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
virtual void OnSerializableUpdate(Serializable *st) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
virtual void OnSerializeTypeCreate(Serialize::Type *st) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a chanserv/set command is used
|
||||
* @param source The source of the command
|
||||
@@ -1022,7 +1024,7 @@ public:
|
||||
* @param setting The setting passed to the command. Probably ON/OFF.
|
||||
* @return EVENT_ALLOW to bypass access checks, EVENT_STOP to halt immediately.
|
||||
*/
|
||||
virtual EventReturn OnSetChannelOption(CommandSource &source, Command *cmd, ChannelInfo *ci, const Anope::string &setting) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnSetChannelOption(CommandSource &source, Command *cmd, ChannelInfo *ci, const Anope::string &setting) ATTR_NOT_NULL(3, 4) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a nickserv/set command is used.
|
||||
* @param source The source of the command
|
||||
@@ -1031,7 +1033,7 @@ public:
|
||||
* @param setting The setting passed to the command. Probably ON/OFF.
|
||||
* @return EVENT_STOP to halt immediately
|
||||
*/
|
||||
virtual EventReturn OnSetNickOption(CommandSource &source, Command *cmd, NickCore *nc, const Anope::string &setting) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnSetNickOption(CommandSource &source, Command *cmd, NickCore *nc, const Anope::string &setting) ATTR_NOT_NULL(3, 4) { throw NotImplementedException(); }
|
||||
|
||||
/** Called whenever a message is received from the uplink
|
||||
* @param source The source of the message
|
||||
@@ -1046,9 +1048,9 @@ public:
|
||||
* @param u The user
|
||||
* @param cm The mode
|
||||
*/
|
||||
virtual EventReturn OnCanSet(User *u, const ChannelMode *cm) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnCanSet(User *u, const ChannelMode *cm) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||
|
||||
virtual EventReturn OnCheckDelete(Channel *) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnCheckDelete(Channel *c) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||
|
||||
/** Called every options:expiretimeout seconds. Should be used to expire nicks,
|
||||
* channels, etc.
|
||||
@@ -1061,7 +1063,7 @@ public:
|
||||
* @param na The nick they are on
|
||||
* @return EVENT_STOP to force the user off of the nick
|
||||
*/
|
||||
virtual EventReturn OnNickValidate(User *u, NickAlias *na) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnNickValidate(User *u, NickAlias *na) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||
};
|
||||
|
||||
enum Implementation
|
||||
|
||||
@@ -79,4 +79,5 @@ public:
|
||||
CertService(Module *c) : Service(c, "CertService", "certs") { }
|
||||
|
||||
virtual NickCore *FindAccountFromCert(const Anope::string &cert) = 0;
|
||||
virtual void ReplaceCert(const Anope::string &oldcert, const Anope::string &newcert) = 0;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2011-2024 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
struct MyOper final
|
||||
: Oper
|
||||
, Serializable
|
||||
{
|
||||
MyOper(const Anope::string &n, OperType *o) : Oper(n, o), Serializable("Oper") { }
|
||||
|
||||
void Serialize(Serialize::Data &data) const override
|
||||
{
|
||||
data["name"] << this->name;
|
||||
data["type"] << this->ot->GetName();
|
||||
}
|
||||
|
||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
{
|
||||
Anope::string stype, sname;
|
||||
|
||||
data["type"] >> stype;
|
||||
data["name"] >> sname;
|
||||
|
||||
OperType *ot = OperType::Find(stype);
|
||||
if (ot == NULL)
|
||||
return NULL;
|
||||
NickCore *nc = NickCore::Find(sname);
|
||||
if (nc == NULL)
|
||||
return NULL;
|
||||
|
||||
MyOper *myo;
|
||||
if (obj)
|
||||
myo = anope_dynamic_static_cast<MyOper *>(obj);
|
||||
else
|
||||
myo = new MyOper(nc->display, ot);
|
||||
nc->o = myo;
|
||||
Log(LOG_NORMAL, "operserv/oper") << "Tied oper " << nc->display << " to type " << ot->GetName();
|
||||
return myo;
|
||||
}
|
||||
};
|
||||
+6
-11
@@ -41,9 +41,9 @@ public:
|
||||
|
||||
virtual ~IRCDProto();
|
||||
|
||||
virtual void SendNoticeInternal(const MessageSource &, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags = {});
|
||||
virtual void SendPrivmsgInternal(const MessageSource &, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags = {});
|
||||
virtual void SendCTCPInternal(const MessageSource &, const Anope::string &dest, const Anope::string &buf);
|
||||
virtual void SendNotice(const MessageSource &source, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags = {});
|
||||
virtual void SendPrivmsg(const MessageSource &source, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags = {});
|
||||
virtual void SendTagmsg(const MessageSource &source, const Anope::string &dest, const Anope::map<Anope::string> &tags);
|
||||
|
||||
/** Parses an incoming message from the IRC server.
|
||||
* @param message The message to parse.
|
||||
@@ -101,9 +101,6 @@ public:
|
||||
/* See ns_cert */
|
||||
bool CanCertFP = false;
|
||||
|
||||
/* Can users log out before being fully connected? */
|
||||
bool CanSVSLogout = false;
|
||||
|
||||
/* Whether this IRCd requires unique IDs for each user or server. See TS6/P10. */
|
||||
bool RequiresID = false;
|
||||
|
||||
@@ -113,6 +110,9 @@ public:
|
||||
/** Can we ask the server to unban a user? */
|
||||
bool CanClearBans = false;
|
||||
|
||||
/** Can we send tag messages? */
|
||||
bool CanTagMessage = false;
|
||||
|
||||
/* The maximum length of a channel name. */
|
||||
size_t MaxChannel = 0;
|
||||
|
||||
@@ -216,11 +216,6 @@ public:
|
||||
|
||||
virtual void SendKick(const MessageSource &source, const Channel *chan, User *user, const Anope::string &msg);
|
||||
|
||||
virtual void SendNotice(const MessageSource &source, const Anope::string &dest, const char *fmt, ...) ATTR_FORMAT(4, 5);
|
||||
virtual void SendPrivmsg(const MessageSource &source, const Anope::string &dest, const char *fmt, ...) ATTR_FORMAT(4, 5);
|
||||
virtual void SendAction(const MessageSource &source, const Anope::string &dest, const char *fmt, ...) ATTR_FORMAT(4, 5);
|
||||
virtual void SendCTCP(const MessageSource &source, const Anope::string &dest, const char *fmt, ...) ATTR_FORMAT(4, 5);
|
||||
|
||||
virtual void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) = 0;
|
||||
virtual void SendGlobalPrivmsg(BotInfo *bi, const Server *desc, const Anope::string &msg) = 0;
|
||||
|
||||
|
||||
@@ -51,6 +51,8 @@
|
||||
|
||||
#if defined __GNUC__
|
||||
# define ATTR_FORMAT(STRINGPOS, FIRSTPOS) __attribute__((format(printf, STRINGPOS, FIRSTPOS)))
|
||||
# define ATTR_NOT_NULL(...) __attribute__((nonnull(__VA_ARGS__)))
|
||||
#else
|
||||
# define ATTR_FORMAT(STRINGPOS, FIRSTPOS)
|
||||
# define ATTR_NOT_NULL(...)
|
||||
#endif
|
||||
|
||||
@@ -215,6 +215,11 @@ public:
|
||||
*/
|
||||
NickCore *Account() const;
|
||||
|
||||
/** Get the account nick the user is logged in using
|
||||
* @return The account nick or NULL
|
||||
*/
|
||||
NickAlias *AccountNick() const;
|
||||
|
||||
/** Check if the user is identified for their nick
|
||||
* @param check_nick True to check if the user is identified to the nickname they are on too
|
||||
* @return true or false
|
||||
|
||||
-10057
File diff suppressed because it is too large
Load Diff
+21
-11
@@ -7,8 +7,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Anope\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2024-04-07 15:51+0100\n"
|
||||
"PO-Revision-Date: 2024-04-07 15:51+0100\n"
|
||||
"POT-Creation-Date: 2024-06-23 14:15+0100\n"
|
||||
"PO-Revision-Date: 2024-06-23 14:16+0100\n"
|
||||
"Last-Translator: Sadie Powell <sadie@witchery.services>\n"
|
||||
"Language-Team: English\n"
|
||||
"Language: en_US\n"
|
||||
@@ -16,7 +16,7 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=ISO-8859-1\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: Poedit 3.4\n"
|
||||
"X-Generator: Poedit 3.4.2\n"
|
||||
|
||||
#, c-format
|
||||
msgid "%d channel(s) cleared, and %d channel(s) dropped."
|
||||
@@ -866,9 +866,9 @@ msgid ""
|
||||
"fantasy commands on a channel when prefixed\n"
|
||||
"with one of the following fantasy characters: %s\n"
|
||||
" \n"
|
||||
"Note that users wanting to use fantaisist\n"
|
||||
"commands MUST have enough access for both\n"
|
||||
"the FANTASIA and the command they are executing."
|
||||
"Note that users wanting to use fantasy commands\n"
|
||||
"MUST have enough access for both the FANTASY\n"
|
||||
"privilege and the command they are executing."
|
||||
msgstr ""
|
||||
" \n"
|
||||
"Enables or disables fantasy mode on a channel.\n"
|
||||
@@ -876,9 +876,9 @@ msgstr ""
|
||||
"fantasy commands on a channel when prefixed\n"
|
||||
"with one of the following fantasy characters: %s\n"
|
||||
" \n"
|
||||
"Note that users wanting to use fantaisist\n"
|
||||
"commands MUST have enough access for both\n"
|
||||
"the FANTASIA and the command they are executing."
|
||||
"Note that users wanting to use fantasy commands\n"
|
||||
"MUST have enough access for both the FANTASY\n"
|
||||
"privilege and the command they are executing."
|
||||
|
||||
msgid ""
|
||||
" \n"
|
||||
@@ -1812,6 +1812,9 @@ msgstr "Account"
|
||||
msgid "Account %s has already reached the maximum number of simultaneous logins (%u)."
|
||||
msgstr "Account %s has already reached the maximum number of simultaneous logins (%u)."
|
||||
|
||||
msgid "Account registered"
|
||||
msgstr "Account registered"
|
||||
|
||||
msgid "Accounts can not be registered right now. Please try again later."
|
||||
msgstr "Accounts can not be registered right now. Please try again later."
|
||||
|
||||
@@ -3666,8 +3669,8 @@ msgstr "Email for %s is invalid."
|
||||
msgid "Email matched: %s (%s) to %s."
|
||||
msgstr "Email matched: %s (%s) to %s."
|
||||
|
||||
msgid "Enable fantaisist commands"
|
||||
msgstr "Enable fantaisist commands"
|
||||
msgid "Enable fantasy commands"
|
||||
msgstr "Enable fantasy commands"
|
||||
|
||||
msgid "Enable greet messages"
|
||||
msgstr "Enable greet messages"
|
||||
@@ -5141,6 +5144,9 @@ msgstr "Nick %s is now released."
|
||||
msgid "Nick %s is now suspended."
|
||||
msgstr "Nick %s is now suspended."
|
||||
|
||||
msgid "Nick registered"
|
||||
msgstr "Nick registered"
|
||||
|
||||
#, c-format
|
||||
msgid "Nick too long, max length is %zu characters."
|
||||
msgstr "Nick too long, max length is %zu characters."
|
||||
@@ -8086,6 +8092,10 @@ msgstr "Used to manage the list of privileged users"
|
||||
msgid "Used to modify the channel status of you or other users"
|
||||
msgstr "Used to modify the channel status of you or other users"
|
||||
|
||||
#, c-format
|
||||
msgid "User %s isn't currently logged in to an account."
|
||||
msgstr "User %s isn't currently logged in to an account."
|
||||
|
||||
msgid "User has been banned from the channel"
|
||||
msgstr "User has been banned from the channel"
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+2350
-4599
File diff suppressed because it is too large
Load Diff
-10224
File diff suppressed because it is too large
Load Diff
+37
-27
@@ -7,8 +7,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Anope\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2024-04-15 15:31+0100\n"
|
||||
"PO-Revision-Date: 2024-04-15 15:32+0100\n"
|
||||
"POT-Creation-Date: 2024-06-23 18:32+0100\n"
|
||||
"PO-Revision-Date: 2024-06-23 16:07+0300\n"
|
||||
"Last-Translator: CaPaCuL <capacul@gmail.com>\n"
|
||||
"Language-Team: Turkish\n"
|
||||
"Language: tr_TR\n"
|
||||
@@ -16,7 +16,7 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: Poedit 3.4\n"
|
||||
"X-Generator: Poedit 3.4.4\n"
|
||||
|
||||
#, c-format
|
||||
msgid "%d channel(s) cleared, and %d channel(s) dropped."
|
||||
@@ -1811,6 +1811,9 @@ msgstr "Hesap"
|
||||
msgid "Account %s has already reached the maximum number of simultaneous logins (%u)."
|
||||
msgstr "%s hesabı zaten maksimum eşzamanlı oturum açma sayısına (%u) ulaştı."
|
||||
|
||||
msgid "Account registered"
|
||||
msgstr "Hesap kaydedildi"
|
||||
|
||||
msgid "Accounts can not be registered right now. Please try again later."
|
||||
msgstr "Hesaplar şu anda kaydedilemiyor. Lütfen daha sonra tekrar deneyiniz."
|
||||
|
||||
@@ -2282,13 +2285,13 @@ msgid ""
|
||||
"message number can be obtained from the output of the QUEUE LIST command.\n"
|
||||
"The QUEUE LIST command lists all messages that are currently in the message queue."
|
||||
msgstr ""
|
||||
"Allows queueing messages to send to users on the network.\n"
|
||||
"Ağdaki kullanıcılara gönderilecek mesajların sıraya alınmasına izin verir.\n"
|
||||
"\n"
|
||||
"The QUEUE ADD command adds the given message to the message queue.\n"
|
||||
"The QUEUE CLEAR command clears the message queue.\n"
|
||||
"The QUEUE DEL command removes the specified message from the message queue. The\n"
|
||||
"message number can be obtained from the output of the QUEUE LIST command.\n"
|
||||
"The QUEUE LIST command lists all messages that are currently in the message queue."
|
||||
"QUEUE ADD komutu verilen mesajı mesaj kuyruğuna ekler.\n"
|
||||
"QUEUE CLEAR komutu mesaj kuyruğunu temizler.\n"
|
||||
"QUEUE DEL komutu belirtilen mesajı mesaj kuyruğundan kaldırır.\n"
|
||||
"mesaj numarası QUEUE LIST komutunun çıktısından alınabilir.\n"
|
||||
"QUEUE LIST komutu, o anda mesaj kuyruğunda bulunan tüm mesajları listeler."
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
@@ -2298,11 +2301,11 @@ msgid ""
|
||||
"You can either send a message by specifying it as a parameter or provide no\n"
|
||||
"parameters to send a previously queued message.\n"
|
||||
msgstr ""
|
||||
"Allows sending messages to all users on a server. The message will be sent\n"
|
||||
"from %s.\n"
|
||||
"Bir sunucudaki tüm kullanıcılara mesaj gönderilmesine izin verir. Mesaj\n"
|
||||
"%s kullanıcısından gönderilecek.\n"
|
||||
"\n"
|
||||
"You can either send a message by specifying it as a parameter or provide no\n"
|
||||
"parameters to send a previously queued message.\n"
|
||||
"Bir mesajı parametre olarak belirterek gönderebilir veya önceden kuyruğa alınmış\n"
|
||||
"bir mesajı göndermek için hiçbir parametre belirtmeyebilirsiniz.\n"
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
@@ -2312,11 +2315,11 @@ msgid ""
|
||||
"You can either send a message by specifying it as a parameter or provide no\n"
|
||||
"parameters to send a previously queued message.\n"
|
||||
msgstr ""
|
||||
"Allows sending messages to all users on the network. The message will be sent\n"
|
||||
"from %s.\n"
|
||||
"Ağdaki tüm kullanıcılara mesaj gönderilmesine izin verir. Mesaj\n"
|
||||
"%s kullanıcısından gidecek.\n"
|
||||
"\n"
|
||||
"You can either send a message by specifying it as a parameter or provide no\n"
|
||||
"parameters to send a previously queued message.\n"
|
||||
"Bir mesajı parametre olarak belirterek gönderebilir veya daha önce kuyruğa\n"
|
||||
"alınmış bir mesajı göndermek için hiçbir parametre belirtmeyebilirsiniz.\n"
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
@@ -3083,7 +3086,7 @@ msgid ""
|
||||
"or changing nick on the network and tells you when and, depending\n"
|
||||
"on channel or user settings, where it was."
|
||||
msgstr ""
|
||||
"Rumuz'un ağa katıldığı, ayrıldığı veya rumuz değiştirdiği\n"
|
||||
"Bu ayar, rumuz'un ağa katıldığı, ayrıldığı veya rumuz değiştirdiği\n"
|
||||
"son zamanı kontrol eder ve bunun ne zaman ve kanal veya kullanıcı\n"
|
||||
"ayarlarına bağlı olarak nerede olduğunu size bildirir."
|
||||
|
||||
@@ -3094,7 +3097,7 @@ msgid ""
|
||||
"Checks whether the _last_ memo you sent to nick has been read\n"
|
||||
"or not. Note that this only works with nicks, not with channels."
|
||||
msgstr ""
|
||||
"Rumuz'a gönderdiğiniz _son_ memonun okunup okunmadığını kontrol eder\n"
|
||||
"Bu ayar, rumuz'a gönderdiğiniz _son_ memonun okunup okunmadığını kontrol eder\n"
|
||||
"Bunun kanallarla değil, yalnızca rumuzlarla işe yaradığını unutmayın."
|
||||
|
||||
#, c-format
|
||||
@@ -4856,7 +4859,7 @@ msgid "Manage your auto join list"
|
||||
msgstr "Oto-gir listenizi yönetin"
|
||||
|
||||
msgid "Manages your pending message queue."
|
||||
msgstr "Manages your pending message queue."
|
||||
msgstr "Bekleyen mesaj sıranızı yönetir."
|
||||
|
||||
#, c-format
|
||||
msgid "Manipulate the %s list"
|
||||
@@ -4941,7 +4944,7 @@ msgstr "%c modu için eksik parametre."
|
||||
|
||||
#, c-format
|
||||
msgid "Missing passwords: %zu"
|
||||
msgstr "Missing passwords: %zu"
|
||||
msgstr "Eksik şifreler: %zu"
|
||||
|
||||
msgid "Mode"
|
||||
msgstr "Mod"
|
||||
@@ -5140,6 +5143,9 @@ msgstr "%s rumuzu şuan serbest bırakıldı."
|
||||
msgid "Nick %s is now suspended."
|
||||
msgstr "%s rumuzu askıya alınmış."
|
||||
|
||||
msgid "Nick registered"
|
||||
msgstr "Rumuz kaydedildi"
|
||||
|
||||
#, c-format
|
||||
msgid "Nick too long, max length is %zu characters."
|
||||
msgstr "Rumuz çok uzun, maks uzunluk %zu karakterdir."
|
||||
@@ -5379,7 +5385,7 @@ msgstr "Şifreler şu anda değiştirilemez. Lütfen daha sonra tekrar deneyiniz
|
||||
|
||||
#, c-format
|
||||
msgid "Passwords encrypted with %s: %zu"
|
||||
msgstr "Passwords encrypted with %s: %zu"
|
||||
msgstr "%s ile şifrelenen şifreler: %zu"
|
||||
|
||||
msgid "Peace"
|
||||
msgstr "Barış"
|
||||
@@ -5397,7 +5403,7 @@ msgstr "Kalıcı"
|
||||
|
||||
#, c-format
|
||||
msgid "Please confirm that you want to drop %s with %s%s DROP %s %s"
|
||||
msgstr "Please confirm that you want to drop %s with %s%s DROP %s %s"
|
||||
msgstr "Lütfen %s rumuzunu droplamak isteğinizi %s%s DROP %s %s ile onaylayın"
|
||||
|
||||
msgid "Please contact an Operator to get a vhost assigned to this nick."
|
||||
msgstr "Bu rumuza atanan bir vHost almak için lütfen bir operle iletişime geçin."
|
||||
@@ -7213,7 +7219,7 @@ msgid ""
|
||||
"for your nick immediately. You may also wish to SET HIDE it\n"
|
||||
"after registering if it isn't the default setting already."
|
||||
msgstr ""
|
||||
"email parametresi isteğe bağlıdır ve rumuzunuzun e-postasını\n"
|
||||
"Bu email parametresi isteğe bağlıdır ve rumuzunuzun e-postasını\n"
|
||||
"hemen ayarlayacaktır. Zaten varsayılan ayar değilse, kayıttan sonra\n"
|
||||
"bunu SET HIDE yapmak da isteyebilirsiniz."
|
||||
|
||||
@@ -7939,7 +7945,7 @@ msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Type %s%s SET EMAIL email in order to set your email."
|
||||
msgstr "Type %s%s SET EMAIL email in order to set your email."
|
||||
msgstr "E-Postanızı ayarlamak için %s%s SET EMAIL e-posta yazın."
|
||||
|
||||
msgid "Un-Load a module"
|
||||
msgstr "Bir modülün yüklemesini kaldır"
|
||||
@@ -8084,6 +8090,10 @@ msgstr "Ayrıcalıklı kullanıcıların listesini yönetmek için kullanılır"
|
||||
msgid "Used to modify the channel status of you or other users"
|
||||
msgstr "Sizin veya diğer kullanıcıların kanal durumunu değiştirmek için kullanılır"
|
||||
|
||||
#, c-format
|
||||
msgid "User %s isn't currently logged in to an account."
|
||||
msgstr "%s kullanıcısı şuan hesabına giriş yapmış değil."
|
||||
|
||||
msgid "User has been banned from the channel"
|
||||
msgstr "Kullanıcı kanaldan banlandı"
|
||||
|
||||
@@ -8324,7 +8334,7 @@ msgid "You can not request a receipt when sending a memo to yourself."
|
||||
msgstr "Kendinize memo gönderirken makbuz talep edemezsiniz."
|
||||
|
||||
msgid "You can not send a single message while you have messages queued."
|
||||
msgstr "You can not send a single message while you have messages queued."
|
||||
msgstr "Sıraya alınmış mesajlarınız varken tek bir mesaj gönderemezsiniz."
|
||||
|
||||
#, c-format
|
||||
msgid "You can't %s yourself!"
|
||||
@@ -8392,7 +8402,7 @@ msgid "You do not have access to set mode %c."
|
||||
msgstr "%c modunu ayarlama erişiminiz yok."
|
||||
|
||||
msgid "You do not have any messages queued and did not specify a message to send."
|
||||
msgstr "You do not have any messages queued and did not specify a message to send."
|
||||
msgstr "Sıraya alınmış herhangi bir mesajınız yok ve gönderilecek mesajı belirtmediniz."
|
||||
|
||||
msgid "You do not have any queued messages."
|
||||
msgstr "Sıraya alınmış mesajınız yok."
|
||||
|
||||
@@ -75,7 +75,8 @@ public:
|
||||
{
|
||||
ChannelMode *cm = ModeManager::FindChannelModeByName("OP");
|
||||
char symbol = cm ? anope_dynamic_static_cast<ChannelModeStatus *>(cm)->symbol : 0;
|
||||
IRCD->SendNotice(bi, (symbol ? Anope::string(symbol) : "") + c->name, "%s invited %s into the channel.", user->nick.c_str(), user->nick.c_str());
|
||||
const auto message = Anope::printf("%s invited %s into the channel.", user->nick.c_str(), user->nick.c_str());
|
||||
IRCD->SendNotice(bi, (symbol ? Anope::string(symbol) : "") + c->name, message);
|
||||
}
|
||||
|
||||
ModeManager::ProcessModes();
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
IRCD->SendPrivmsg(*ci->bi, ci->name, "%s", text.c_str());
|
||||
IRCD->SendPrivmsg(*ci->bi, ci->name, text);
|
||||
ci->bi->lastmsg = Anope::CurTime;
|
||||
|
||||
bool override = !source.AccessFor(ci).HasPriv("SAY");
|
||||
@@ -111,11 +111,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
message = message.replace_all_cs("\1", "");
|
||||
if (message.empty())
|
||||
return;
|
||||
|
||||
IRCD->SendAction(*ci->bi, ci->name, "%s", message.c_str());
|
||||
IRCD->SendPrivmsg(*ci->bi, ci->name, Anope::FormatCTCP("ACTION", message));
|
||||
ci->bi->lastmsg = Anope::CurTime;
|
||||
|
||||
bool override = !source.AccessFor(ci).HasPriv("SAY");
|
||||
|
||||
+13
-16
@@ -53,17 +53,16 @@ struct KickerDataImpl final
|
||||
if (kd == NULL)
|
||||
return;
|
||||
|
||||
data["kickerdata:amsgs"] << kd->amsgs;
|
||||
data["kickerdata:badwords"] << kd->badwords;
|
||||
data["kickerdata:bolds"] << kd->bolds;
|
||||
data["kickerdata:caps"] << kd->caps;
|
||||
data["kickerdata:colors"] << kd->colors;
|
||||
data["kickerdata:flood"] << kd->flood;
|
||||
data["kickerdata:italics"] << kd->italics;
|
||||
data["kickerdata:repeat"] << kd->repeat;
|
||||
data["kickerdata:reverses"] << kd->reverses;
|
||||
data["kickerdata:underlines"] << kd->underlines;
|
||||
|
||||
data.SetType("kickerdata:amsgs", Serialize::Data::DT_INT); data["kickerdata:amsgs"] << kd->amsgs;
|
||||
data.SetType("kickerdata:badwords", Serialize::Data::DT_INT); data["kickerdata:badwords"] << kd->badwords;
|
||||
data.SetType("kickerdata:bolds", Serialize::Data::DT_INT); data["kickerdata:bolds"] << kd->bolds;
|
||||
data.SetType("kickerdata:caps", Serialize::Data::DT_INT); data["kickerdata:caps"] << kd->caps;
|
||||
data.SetType("kickerdata:colors", Serialize::Data::DT_INT); data["kickerdata:colors"] << kd->colors;
|
||||
data.SetType("kickerdata:flood", Serialize::Data::DT_INT); data["kickerdata:flood"] << kd->flood;
|
||||
data.SetType("kickerdata:italics", Serialize::Data::DT_INT); data["kickerdata:italics"] << kd->italics;
|
||||
data.SetType("kickerdata:repeat", Serialize::Data::DT_INT); data["kickerdata:repeat"] << kd->repeat;
|
||||
data.SetType("kickerdata:reverses", Serialize::Data::DT_INT); data["kickerdata:reverses"] << kd->reverses;
|
||||
data.SetType("kickerdata:underlines", Serialize::Data::DT_INT); data["kickerdata:underlines"] << kd->underlines;
|
||||
data.SetType("capsmin", Serialize::Data::DT_INT); data["capsmin"] << kd->capsmin;
|
||||
data.SetType("capspercent", Serialize::Data::DT_INT); data["capspercent"] << kd->capspercent;
|
||||
data.SetType("floodlines", Serialize::Data::DT_INT); data["floodlines"] << kd->floodlines;
|
||||
@@ -1216,11 +1215,9 @@ public:
|
||||
/* If it's a /me, cut the CTCP part because the ACTION will cause
|
||||
* problems with the caps or badwords kicker
|
||||
*/
|
||||
if (realbuf.substr(0, 8).equals_ci("\1ACTION ") && realbuf[realbuf.length() - 1] == '\1')
|
||||
{
|
||||
realbuf.erase(0, 8);
|
||||
realbuf.erase(realbuf.length() - 1);
|
||||
}
|
||||
Anope::string ctcpname, ctcpbody;
|
||||
if (Anope::ParseCTCP(msg, ctcpname, ctcpbody) && ctcpname.equals_ci("ACTION"))
|
||||
realbuf = ctcpbody;
|
||||
|
||||
if (realbuf.empty())
|
||||
return;
|
||||
|
||||
@@ -391,11 +391,11 @@ public:
|
||||
/* Sending a channel message or notice in response to a fantasy command */;
|
||||
else if (log->method.equals_ci("MESSAGE") && l->ci->c)
|
||||
{
|
||||
IRCD->SendPrivmsg(l->ci->WhoSends(), log->extra + l->ci->c->name, "%s", buffer.c_str());
|
||||
IRCD->SendPrivmsg(l->ci->WhoSends(), log->extra + l->ci->c->name, buffer);
|
||||
l->ci->WhoSends()->lastmsg = Anope::CurTime;
|
||||
}
|
||||
else if (log->method.equals_ci("NOTICE") && l->ci->c)
|
||||
IRCD->SendNotice(l->ci->WhoSends(), log->extra + l->ci->c->name, "%s", buffer.c_str());
|
||||
IRCD->SendNotice(l->ci->WhoSends(), log->extra + l->ci->c->name, buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -658,7 +658,8 @@ class CommandCSMode final
|
||||
}
|
||||
else
|
||||
{
|
||||
for (const auto &mode : ci->c->GetModeList(cm->name))
|
||||
std::vector<Anope::string> v = ci->c->GetModeList(cm->name);
|
||||
for (const auto &mode : v)
|
||||
{
|
||||
if (Anope::Match(mode, param))
|
||||
ci->c->RemoveMode(NULL, cm, mode);
|
||||
|
||||
@@ -1146,7 +1146,7 @@ public:
|
||||
if (c->ci && keep_modes.HasExt(c->ci))
|
||||
{
|
||||
Channel::ModeList ml = c->ci->last_modes;
|
||||
for (const auto &[last_mode, last_value] : c->ci->last_modes)
|
||||
for (const auto &[last_mode, last_value] : ml)
|
||||
c->SetMode(c->ci->WhoSends(), last_mode, last_value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
const Anope::string &chan = params[0];
|
||||
Anope::string expiry = params[1];
|
||||
Anope::string reason = params.size() > 2 ? params[2] : "";
|
||||
time_t expiry_secs = Config->GetModule(this->owner)->Get<time_t>("expire");
|
||||
time_t expiry_secs = Config->GetModule(this->owner)->Get<time_t>("suspendexpire");
|
||||
|
||||
if (!expiry.empty() && expiry[0] != '+')
|
||||
{
|
||||
|
||||
+262
-83
@@ -20,6 +20,8 @@
|
||||
#include "modules/info.h"
|
||||
#include "modules/ns_cert.h"
|
||||
#include "modules/os_forbid.h"
|
||||
#include "modules/os_oper.h"
|
||||
#include "modules/os_session.h"
|
||||
#include "modules/suspend.h"
|
||||
|
||||
// Handles reading from an Atheme database row.
|
||||
@@ -83,20 +85,39 @@ public:
|
||||
|
||||
struct ModeData final
|
||||
{
|
||||
char letter;
|
||||
Anope::string name;
|
||||
Anope::string value;
|
||||
bool set;
|
||||
|
||||
ModeData(const Anope::string &n, bool s, const Anope::string &v = "")
|
||||
: name(n)
|
||||
: letter(0)
|
||||
, name(n)
|
||||
, value(v)
|
||||
, set(s)
|
||||
{
|
||||
}
|
||||
|
||||
ModeData(char l, const Anope::string &v = "")
|
||||
: letter(l)
|
||||
, value(v)
|
||||
, set(true)
|
||||
{
|
||||
}
|
||||
|
||||
Anope::string str() const
|
||||
{
|
||||
std::stringstream buf;
|
||||
buf << '+' << (name.empty() ? letter : name);
|
||||
if (value.empty())
|
||||
buf << ' ' << value;
|
||||
return buf.str();
|
||||
}
|
||||
};
|
||||
|
||||
struct ChannelData final
|
||||
{
|
||||
Anope::unordered_map<AutoKick *> akicks;
|
||||
Anope::string bot;
|
||||
Anope::string info_adder;
|
||||
Anope::string info_message;
|
||||
@@ -126,6 +147,12 @@ struct UserData final
|
||||
time_t vhost_ts = 0;
|
||||
};
|
||||
|
||||
namespace
|
||||
{
|
||||
// Whether we can safely import clones.
|
||||
bool import_clones = true;
|
||||
}
|
||||
|
||||
class DBAtheme final
|
||||
: public Module
|
||||
{
|
||||
@@ -133,71 +160,70 @@ private:
|
||||
ServiceReference<AccessProvider> accessprov;
|
||||
PrimitiveExtensibleItem<ChannelData> chandata;
|
||||
std::map<Anope::string, char> flags;
|
||||
ServiceReference<ForbidService> forbidsvc;
|
||||
PrimitiveExtensibleItem<UserData> userdata;
|
||||
ServiceReference<XLineManager> sglinemgr;
|
||||
ServiceReference<XLineManager> snlinemgr;
|
||||
ServiceReference<XLineManager> sqlinemgr;
|
||||
|
||||
Anope::map<std::function<bool(DBAtheme*,AthemeRow&)>> rowhandlers = {
|
||||
{ "AC", &DBAtheme::HandleIgnore },
|
||||
{ "AR", &DBAtheme::HandleIgnore },
|
||||
{ "BE", &DBAtheme::HandleBE },
|
||||
{ "BLE", &DBAtheme::HandleIgnore },
|
||||
{ "BOT", &DBAtheme::HandleBOT },
|
||||
{ "BOT-COUNT", &DBAtheme::HandleIgnore },
|
||||
{ "BW", &DBAtheme::HandleBW },
|
||||
{ "CA", &DBAtheme::HandleCA },
|
||||
{ "CF", &DBAtheme::HandleIgnore },
|
||||
{ "CFCHAN", &DBAtheme::HandleIgnore },
|
||||
{ "CFDBV", &DBAtheme::HandleIgnore },
|
||||
{ "CFMD", &DBAtheme::HandleIgnore },
|
||||
{ "CFOP", &DBAtheme::HandleIgnore },
|
||||
{ "CLONES-CD", &DBAtheme::HandleIgnore },
|
||||
{ "CLONES-CK", &DBAtheme::HandleIgnore },
|
||||
{ "CLONES-DBV", &DBAtheme::HandleIgnore },
|
||||
{ "CLONES-EX", &DBAtheme::HandleIgnore },
|
||||
{ "CLONES-GR", &DBAtheme::HandleIgnore },
|
||||
{ "CSREQ", &DBAtheme::HandleIgnore },
|
||||
{ "CSREQ", &DBAtheme::HandleIgnore },
|
||||
{ "DBV", &DBAtheme::HandleDBV },
|
||||
{ "GACL", &DBAtheme::HandleIgnore },
|
||||
{ "GDBV", &DBAtheme::HandleIgnore },
|
||||
{ "GE", &DBAtheme::HandleIgnore },
|
||||
{ "GFA", &DBAtheme::HandleIgnore },
|
||||
{ "GRP", &DBAtheme::HandleIgnore },
|
||||
{ "GRVER", &DBAtheme::HandleGRVER },
|
||||
{ "HE", &DBAtheme::HandleIgnore },
|
||||
{ "HO", &DBAtheme::HandleIgnore },
|
||||
{ "HR", &DBAtheme::HandleHR },
|
||||
{ "JM", &DBAtheme::HandleIgnore },
|
||||
{ "KID", &DBAtheme::HandleIgnore },
|
||||
{ "KL", &DBAtheme::HandleKL },
|
||||
{ "LUID", &DBAtheme::HandleIgnore },
|
||||
{ "MC", &DBAtheme::HandleMC },
|
||||
{ "MCFP", &DBAtheme::HandleMCFP },
|
||||
{ "MDA", &DBAtheme::HandleMDA },
|
||||
{ "MDC", &DBAtheme::HandleMDC },
|
||||
{ "MDEP", &DBAtheme::HandleIgnore },
|
||||
{ "MDG", &DBAtheme::HandleIgnore },
|
||||
{ "MDN", &DBAtheme::HandleMDN },
|
||||
{ "MDU", &DBAtheme::HandleMDU },
|
||||
{ "ME", &DBAtheme::HandleME },
|
||||
{ "MI", &DBAtheme::HandleMI },
|
||||
{ "MM", &DBAtheme::HandleMM },
|
||||
{ "MN", &DBAtheme::HandleMN },
|
||||
{ "MU", &DBAtheme::HandleMU },
|
||||
{ "NAM", &DBAtheme::HandleNAM },
|
||||
{ "QID", &DBAtheme::HandleIgnore },
|
||||
{ "QL", &DBAtheme::HandleQL },
|
||||
{ "RM", &DBAtheme::HandleIgnore },
|
||||
{ "RR", &DBAtheme::HandleIgnore },
|
||||
{ "RW", &DBAtheme::HandleIgnore },
|
||||
{ "SI", &DBAtheme::HandleIgnore },
|
||||
{ "SO", &DBAtheme::HandleIgnore },
|
||||
{ "TS", &DBAtheme::HandleIgnore },
|
||||
{ "XID", &DBAtheme::HandleIgnore },
|
||||
{ "XL", &DBAtheme::HandleXL },
|
||||
{ "AC", &DBAtheme::HandleIgnore },
|
||||
{ "AR", &DBAtheme::HandleIgnore },
|
||||
{ "BE", &DBAtheme::HandleBE },
|
||||
{ "BLE", &DBAtheme::HandleIgnore },
|
||||
{ "BOT", &DBAtheme::HandleBOT },
|
||||
{ "BOT-COUNT", &DBAtheme::HandleIgnore },
|
||||
{ "BW", &DBAtheme::HandleBW },
|
||||
{ "CA", &DBAtheme::HandleCA },
|
||||
{ "CF", &DBAtheme::HandleIgnore },
|
||||
{ "CFCHAN", &DBAtheme::HandleIgnore },
|
||||
{ "CFDBV", &DBAtheme::HandleIgnore },
|
||||
{ "CFMD", &DBAtheme::HandleIgnore },
|
||||
{ "CFOP", &DBAtheme::HandleIgnore },
|
||||
{ "CLONES-CD", &DBAtheme::HandleIgnore },
|
||||
{ "CLONES-CK", &DBAtheme::HandleIgnore },
|
||||
{ "CLONES-DBV", &DBAtheme::HandleCLONESDBV },
|
||||
{ "CLONES-EX", &DBAtheme::HandleCLONESEX },
|
||||
{ "CLONES-GR", &DBAtheme::HandleIgnore },
|
||||
{ "CSREQ", &DBAtheme::HandleIgnore },
|
||||
{ "CSREQ", &DBAtheme::HandleIgnore },
|
||||
{ "DBV", &DBAtheme::HandleDBV },
|
||||
{ "GACL", &DBAtheme::HandleIgnore },
|
||||
{ "GDBV", &DBAtheme::HandleIgnore },
|
||||
{ "GE", &DBAtheme::HandleIgnore },
|
||||
{ "GFA", &DBAtheme::HandleIgnore },
|
||||
{ "GRP", &DBAtheme::HandleIgnore },
|
||||
{ "GRVER", &DBAtheme::HandleGRVER },
|
||||
{ "HE", &DBAtheme::HandleIgnore },
|
||||
{ "HO", &DBAtheme::HandleIgnore },
|
||||
{ "HR", &DBAtheme::HandleHR },
|
||||
{ "JM", &DBAtheme::HandleIgnore },
|
||||
{ "KID", &DBAtheme::HandleIgnore },
|
||||
{ "KL", &DBAtheme::HandleKL },
|
||||
{ "LUID", &DBAtheme::HandleIgnore },
|
||||
{ "MC", &DBAtheme::HandleMC },
|
||||
{ "MCFP", &DBAtheme::HandleMCFP },
|
||||
{ "MDA", &DBAtheme::HandleMDA },
|
||||
{ "MDC", &DBAtheme::HandleMDC },
|
||||
{ "MDEP", &DBAtheme::HandleIgnore },
|
||||
{ "MDG", &DBAtheme::HandleIgnore },
|
||||
{ "MDN", &DBAtheme::HandleMDN },
|
||||
{ "MDU", &DBAtheme::HandleMDU },
|
||||
{ "ME", &DBAtheme::HandleME },
|
||||
{ "MI", &DBAtheme::HandleMI },
|
||||
{ "MM", &DBAtheme::HandleMM },
|
||||
{ "MN", &DBAtheme::HandleMN },
|
||||
{ "MU", &DBAtheme::HandleMU },
|
||||
{ "NAM", &DBAtheme::HandleNAM },
|
||||
{ "QID", &DBAtheme::HandleIgnore },
|
||||
{ "QL", &DBAtheme::HandleQL },
|
||||
{ "RM", &DBAtheme::HandleIgnore },
|
||||
{ "RR", &DBAtheme::HandleIgnore },
|
||||
{ "RW", &DBAtheme::HandleIgnore },
|
||||
{ "SI", &DBAtheme::HandleIgnore },
|
||||
{ "SO", &DBAtheme::HandleSO },
|
||||
{ "TS", &DBAtheme::HandleIgnore },
|
||||
{ "XID", &DBAtheme::HandleIgnore },
|
||||
{ "XL", &DBAtheme::HandleXL },
|
||||
};
|
||||
|
||||
void ApplyAccess(Anope::string &in, char flag, Anope::string &out, std::initializer_list<const char*> privs)
|
||||
@@ -403,6 +429,9 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
// We are processing an encrypted password.
|
||||
flags.erase(pos, 1);
|
||||
|
||||
// Atheme supports several password hashing methods. We can only import
|
||||
// some of them currently.
|
||||
//
|
||||
@@ -480,7 +509,7 @@ private:
|
||||
|
||||
bool HandleBE(AthemeRow &row)
|
||||
{
|
||||
// BE <email <created> <creator> <reason>
|
||||
// BE <email> <created> <creator> <reason>
|
||||
auto email = row.Get();
|
||||
auto created = row.GetNum<time_t>();
|
||||
auto creator = row.Get();
|
||||
@@ -489,19 +518,19 @@ private:
|
||||
if (!row)
|
||||
return row.LogError(this);
|
||||
|
||||
if (!forbidsvc)
|
||||
if (!forbid_service)
|
||||
{
|
||||
Log(this) << "Unable to convert forbidden email " << email << " as os_forbid is not loaded";
|
||||
return true;
|
||||
}
|
||||
|
||||
auto *forbid = forbidsvc->CreateForbid();
|
||||
auto *forbid = forbid_service->CreateForbid();
|
||||
forbid->created = created;
|
||||
forbid->creator = creator;
|
||||
forbid->mask = email;
|
||||
forbid->reason = reason;
|
||||
forbid->type = FT_EMAIL;
|
||||
forbidsvc->AddForbid(forbid);
|
||||
forbid_service->AddForbid(forbid);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -583,10 +612,11 @@ private:
|
||||
auto *nc = NickCore::Find(mask);
|
||||
if (flags.find('b') != Anope::string::npos)
|
||||
{
|
||||
auto *data = chandata.Require(ci);
|
||||
if (nc)
|
||||
ci->AddAkick(setter, nc, "", modifiedtime, modifiedtime);
|
||||
data->akicks[mask] = ci->AddAkick(setter, nc, "", modifiedtime, modifiedtime);
|
||||
else
|
||||
ci->AddAkick(setter, mask, "", modifiedtime, modifiedtime);
|
||||
data->akicks[mask] = ci->AddAkick(setter, mask, "", modifiedtime, modifiedtime);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -626,15 +656,59 @@ private:
|
||||
}
|
||||
|
||||
if (flags != "+")
|
||||
Log(this) << "Unable to convert channel access flags " << flags << " for " << ci->name;
|
||||
Log(this) << "Unable to convert channel access flags " << flags << " for " << mask << " on " << ci->name;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool HandleCLONESDBV(AthemeRow &row)
|
||||
{
|
||||
// CLONES-DBV <version>
|
||||
auto version = row.GetNum<unsigned>();
|
||||
if (version != 3)
|
||||
{
|
||||
Log(this) << "Clones database is version " << version << " which is not supported!";
|
||||
import_clones = false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool HandleCLONESEX(AthemeRow &row)
|
||||
{
|
||||
if (!import_clones)
|
||||
return HandleIgnore(row);
|
||||
|
||||
// CLONES-EX <ip> <allowed> <warn> <expires> <reason>
|
||||
auto ip = row.Get();
|
||||
auto allowed = row.GetNum<unsigned>();
|
||||
/* auto warn = */ row.GetNum<unsigned>();
|
||||
auto expires = row.GetNum<time_t>();
|
||||
auto reason = row.GetRemaining();
|
||||
|
||||
if (!row)
|
||||
return row.LogError(this);
|
||||
|
||||
if (!session_service)
|
||||
{
|
||||
Log(this) << "Unable to import session limit for " << ip << " as os_session is not loaded";
|
||||
return true;
|
||||
}
|
||||
|
||||
auto *exception = session_service->CreateException();
|
||||
exception->mask = ip;
|
||||
exception->limit = allowed;
|
||||
exception->who = "Unknown";
|
||||
exception->time = Anope::CurTime;
|
||||
exception->expires = expires;
|
||||
exception->reason = reason;
|
||||
session_service->AddException(exception);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool HandleDBV(AthemeRow &row)
|
||||
{
|
||||
// DBV <version>
|
||||
unsigned version = row.GetNum<unsigned>();
|
||||
auto version = row.GetNum<unsigned>();
|
||||
if (version != 12)
|
||||
{
|
||||
Log(this) << "Database is version " << version << " which is not supported!";
|
||||
@@ -646,7 +720,7 @@ private:
|
||||
bool HandleGRVER(AthemeRow &row)
|
||||
{
|
||||
// GRVER <version>
|
||||
unsigned version = row.GetNum<unsigned>();
|
||||
auto version = row.GetNum<unsigned>();
|
||||
if (version != 1)
|
||||
{
|
||||
Log(this) << "Database grammar is version " << version << " which is not supported!";
|
||||
@@ -718,6 +792,12 @@ private:
|
||||
return true;
|
||||
}
|
||||
|
||||
bool HandleIgnoreMetadata(const Anope::string &target, const Anope::string &key, const Anope::string &value)
|
||||
{
|
||||
Log(LOG_DEBUG_3) << "Intentionally ignoring Atheme database metadata for " << target << ": " << key << " = " << value;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool HandleMC(AthemeRow &row)
|
||||
{
|
||||
// MC <channel> <regtime> <used> <flags> <mlock-on> <mlock-off> <mlock-limit> [<mlock-key>]
|
||||
@@ -822,7 +902,7 @@ private:
|
||||
bool HandleMDA(AthemeRow &row)
|
||||
{
|
||||
// MDA <channel> <account/mask> <key> <value>
|
||||
auto display = row.Get();
|
||||
auto channel = row.Get();
|
||||
auto mask = row.Get();
|
||||
auto key = row.Get();
|
||||
auto value = row.GetRemaining();
|
||||
@@ -830,7 +910,23 @@ private:
|
||||
if (!row)
|
||||
return row.LogError(this);
|
||||
|
||||
Log(this) << "Unknown channel access metadata " << key << " = " << value;
|
||||
auto *ci = ChannelInfo::Find(channel);
|
||||
if (!ci)
|
||||
{
|
||||
Log(this) << "Missing ChannelInfo for MDA: " << channel;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (key == "reason")
|
||||
{
|
||||
auto *data = chandata.Require(ci);
|
||||
auto akick = data->akicks.find(mask);
|
||||
if (akick != data->akicks.end())
|
||||
akick->second->reason = value;
|
||||
}
|
||||
else
|
||||
Log(this) << "Unknown channel access metadata for " << mask << " on " << ci->name << ": " << key << " = " << value;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -858,6 +954,8 @@ private:
|
||||
ci->Extend<bool>("BS_FANTASY");
|
||||
else if (key == "private:botserv:no-bot")
|
||||
ci->Extend<bool>("BS_NOBOT");
|
||||
else if (key == "private:channelts")
|
||||
return HandleIgnoreMetadata(ci->name, key, value);
|
||||
else if (key == "private:close:closer")
|
||||
data->suspend_by = value;
|
||||
else if (key == "private:close:reason")
|
||||
@@ -892,29 +990,60 @@ private:
|
||||
data->info_adder = value;
|
||||
else if (key == "private:mark:timestamp")
|
||||
data->info_ts = Anope::Convert<time_t>(value, 0);
|
||||
else if (key == "private:mlockext")
|
||||
{
|
||||
spacesepstream mlocks(value);
|
||||
for (Anope::string mlock; mlocks.GetToken(mlock); )
|
||||
data->mlocks.emplace_back(mlock[0], mlock.substr(1));
|
||||
}
|
||||
else if (key == "private:templates")
|
||||
return HandleIgnoreMetadata(ci->name, key, value);
|
||||
else if (key == "private:topic:setter")
|
||||
ci->last_topic_setter = value;
|
||||
else if (key == "private:topic:text")
|
||||
ci->last_topic = value;
|
||||
else if (key == "private:topic:ts")
|
||||
ci->last_topic_time = Anope::Convert<time_t>(value, 0);
|
||||
else if (key.compare(0, 14, "private:stats:", 14) == 0)
|
||||
return HandleIgnoreMetadata(ci->name, key, value);
|
||||
else
|
||||
Log(this) << "Unknown channel metadata " << key << " = " << value;
|
||||
Log(this) << "Unknown channel metadata for " << ci->name << ": " << key << " = " << value;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool HandleMDN(AthemeRow &row)
|
||||
{
|
||||
// MDN <display> <key> <value>
|
||||
auto display = row.Get();
|
||||
// MDN <nick> <key> <value>
|
||||
auto nick = row.Get();
|
||||
auto key = row.Get();
|
||||
auto value = row.GetRemaining();
|
||||
|
||||
if (!row)
|
||||
return row.LogError(this);
|
||||
|
||||
Log(this) << "Unknown nick metadata " << key << " = " << value;
|
||||
if (!forbid_service)
|
||||
{
|
||||
Log(this) << "Unable to convert forbidden nick " << nick << " metadata as os_forbid is not loaded";
|
||||
return true;
|
||||
}
|
||||
|
||||
auto *forbid = forbid_service->FindForbidExact(nick, FT_NICK);
|
||||
if (!forbid)
|
||||
{
|
||||
Log(this) << "Missing forbid for MDN: " << nick;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (key == "private:mark:reason")
|
||||
forbid->reason = value;
|
||||
else if (key == "private:mark:setter")
|
||||
forbid->creator = value;
|
||||
else if (key == "private:mark:timestamp")
|
||||
forbid->created = Anope::Convert<time_t>(value, 0);
|
||||
else
|
||||
Log(this) << "Unknown forbidden nick metadata for " << forbid->mask << ": " << key << " = " << value;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -967,12 +1096,20 @@ private:
|
||||
data->last_mask = value;
|
||||
else if (key == "private:lastquit:message")
|
||||
data->last_quit = value;
|
||||
else if (key == "private:loginfail:failnum")
|
||||
return HandleIgnoreMetadata(nc->display, key, value);
|
||||
else if (key == "private:loginfail:lastfailaddr")
|
||||
return HandleIgnoreMetadata(nc->display, key, value);
|
||||
else if (key == "private:loginfail:lastfailtime")
|
||||
return HandleIgnoreMetadata(nc->display, key, value);
|
||||
else if (key == "private:mark:reason")
|
||||
data->info_message = value;
|
||||
else if (key == "private:mark:setter")
|
||||
data->info_adder = value;
|
||||
else if (key == "private:mark:timestamp")
|
||||
data->info_ts = Anope::Convert<time_t>(value, 0);
|
||||
else if (key == "private:swhois")
|
||||
return HandleIgnoreMetadata(nc->display, key, value);
|
||||
else if (key == "private:usercloak")
|
||||
data->vhost = value;
|
||||
else if (key == "private:usercloak-assigner")
|
||||
@@ -982,7 +1119,7 @@ private:
|
||||
else if (key.compare(0, 18, "private:usercloak:", 18) == 0)
|
||||
data->vhost_nick[key.substr(18)] = value;
|
||||
else
|
||||
Log(this) << "Unknown account metadata " << key << " = " << value;
|
||||
Log(this) << "Unknown account metadata for " << nc->display << ": " << key << " = " << value;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1131,7 +1268,7 @@ private:
|
||||
auto display = row.Get();
|
||||
auto pass = row.Get();
|
||||
auto email = row.Get();
|
||||
/* auto regtime = */ row.GetNum<time_t>();
|
||||
auto regtime = row.GetNum<time_t>();
|
||||
/* auto lastlogin = */ row.Get();
|
||||
auto flags = row.Get();
|
||||
auto language = row.Get();
|
||||
@@ -1141,6 +1278,7 @@ private:
|
||||
|
||||
auto *nc = new NickCore(display);
|
||||
nc->email = email;
|
||||
nc->time_registered = regtime;
|
||||
ApplyPassword(nc, flags, pass);
|
||||
|
||||
// No equivalent: bglmNQrS
|
||||
@@ -1199,18 +1337,18 @@ private:
|
||||
if (!row)
|
||||
return row.LogError(this);
|
||||
|
||||
if (!forbidsvc)
|
||||
if (!forbid_service)
|
||||
{
|
||||
Log(this) << "Unable to convert forbidden nick " << nick << " as os_forbid is not loaded";
|
||||
return true;
|
||||
}
|
||||
|
||||
auto *forbid = forbidsvc->CreateForbid();
|
||||
auto *forbid = forbid_service->CreateForbid();
|
||||
forbid->creator = "Unknown";
|
||||
forbid->mask = nick;
|
||||
forbid->reason = "Unknown";
|
||||
forbid->type = FT_NICK;
|
||||
forbidsvc->AddForbid(forbid);
|
||||
forbid_service->AddForbid(forbid);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1238,6 +1376,43 @@ private:
|
||||
return true;
|
||||
}
|
||||
|
||||
bool HandleSO(AthemeRow &row)
|
||||
{
|
||||
// SO <display> <type> <flags>
|
||||
auto display = row.Get();
|
||||
auto type = row.Get();
|
||||
auto flags = row.Get();
|
||||
|
||||
if (!row)
|
||||
return row.LogError(this);
|
||||
|
||||
auto *nc = NickCore::Find(display);
|
||||
if (!nc)
|
||||
{
|
||||
Log(this) << "Missing NickCore for SO: " << display;
|
||||
return false;
|
||||
}
|
||||
|
||||
auto ot = OperType::Find(type);
|
||||
if (!ot)
|
||||
{
|
||||
// Attempt to convert oper types.
|
||||
if (type == "sra")
|
||||
ot = OperType::Find("Services Root");
|
||||
else if (type == "ircop")
|
||||
ot = OperType::Find("Services Operator");
|
||||
}
|
||||
|
||||
if (!ot)
|
||||
{
|
||||
Log(this) << "Unable to convert operator status for " << nc->display << " as there is no equivalent oper type: " << type;
|
||||
return true;
|
||||
}
|
||||
|
||||
nc->o = new MyOper(nc->display, ot);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool HandleXL(AthemeRow &row)
|
||||
{
|
||||
// XL <id> <real> <duration> <settime> <setby> <reason>
|
||||
@@ -1267,7 +1442,6 @@ public:
|
||||
: Module(modname, creator, DATABASE | VENDOR)
|
||||
, accessprov("AccessProvider", "access/flags")
|
||||
, chandata(this, "ATHEME_CHANDATA")
|
||||
, forbidsvc("ForbidService", "forbid")
|
||||
, userdata(this, "ATHEME_USERDATA")
|
||||
, sglinemgr("XLineManager","xlinemanager/sgline")
|
||||
, snlinemgr("XLineManager","xlinemanager/snline")
|
||||
@@ -1416,16 +1590,21 @@ public:
|
||||
|
||||
for (const auto &mlock : data->mlocks)
|
||||
{
|
||||
auto mh = ModeManager::FindChannelModeByName(mlock.name);
|
||||
ChannelMode *mh;
|
||||
if (mlock.name.empty())
|
||||
mh = ModeManager::FindChannelModeByChar(mlock.letter);
|
||||
else
|
||||
mh = ModeManager::FindChannelModeByName(mlock.name);
|
||||
if (!mh)
|
||||
{
|
||||
Log(this) << "Unable to find mode while importing mode lock: " << mlock.name;
|
||||
Log(this) << "Unable to find mode while importing mode lock on " << ci->name << ": " << mlock.str();
|
||||
continue;
|
||||
}
|
||||
|
||||
ml->SetMLock(mh, mlock.set, mlock.value, "Unknown");
|
||||
}
|
||||
}
|
||||
Anope::SaveDatabases();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -252,7 +252,7 @@ static Anope::string GetLevelName(int level)
|
||||
case 15:
|
||||
return "NOKICK";
|
||||
case 16:
|
||||
return "FANTASIA";
|
||||
return "FANTASY";
|
||||
case 17:
|
||||
return "SAY";
|
||||
case 18:
|
||||
@@ -537,24 +537,18 @@ static void LoadNicks()
|
||||
case LANG_DE:
|
||||
nc->language = "de_DE.UTF-8";
|
||||
break;
|
||||
case LANG_CAT:
|
||||
nc->language = "ca_ES.UTF-8"; // yes, iso639 defines catalan as CA
|
||||
break;
|
||||
case LANG_GR:
|
||||
nc->language = "el_GR.UTF-8";
|
||||
break;
|
||||
case LANG_NL:
|
||||
nc->language = "nl_NL.UTF-8";
|
||||
break;
|
||||
case LANG_RU:
|
||||
nc->language = "ru_RU.UTF-8";
|
||||
break;
|
||||
case LANG_HUN:
|
||||
nc->language = "hu_HU.UTF-8";
|
||||
break;
|
||||
case LANG_PL:
|
||||
nc->language = "pl_PL.UTF-8";
|
||||
break;
|
||||
case LANG_CAT:
|
||||
case LANG_HUN:
|
||||
case LANG_RU:
|
||||
case LANG_EN_US:
|
||||
case LANG_JA_JIS:
|
||||
case LANG_JA_EUC:
|
||||
@@ -1348,6 +1342,7 @@ public:
|
||||
if (ci->c)
|
||||
ci->c->CheckModes();
|
||||
}
|
||||
Anope::SaveDatabases();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ private:
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Anope::CurTime - Config->GetBlock("options")->Get<time_t>("updatetimeout", "5m") > lastwarn)
|
||||
if (Anope::CurTime - Config->GetBlock("options")->Get<time_t>("updatetimeout", "2m") > lastwarn)
|
||||
{
|
||||
Log() << "Unable to locate SQL reference, going to readonly...";
|
||||
Anope::ReadOnly = this->ro = true;
|
||||
|
||||
+10
-5
@@ -354,9 +354,14 @@ Result MySQLService::RunQuery(const Query &query)
|
||||
{
|
||||
this->Lock.lock();
|
||||
|
||||
Anope::string real_query = this->BuildQuery(query);
|
||||
if (!this->CheckConnection())
|
||||
{
|
||||
this->Lock.unlock();
|
||||
return MySQLResult(query, query.query, mysql_error(this->sql));
|
||||
}
|
||||
|
||||
if (this->CheckConnection() && !mysql_real_query(this->sql, real_query.c_str(), real_query.length()))
|
||||
Anope::string real_query = this->BuildQuery(query);
|
||||
if (!mysql_real_query(this->sql, real_query.c_str(), real_query.length()))
|
||||
{
|
||||
MYSQL_RES *res = mysql_store_result(this->sql);
|
||||
unsigned int id = mysql_insert_id(this->sql);
|
||||
@@ -410,11 +415,11 @@ std::vector<Query> MySQLService::CreateTable(const Anope::string &table, const D
|
||||
|
||||
query_text += ", `" + column + "` ";
|
||||
if (data.GetType(column) == Serialize::Data::DT_INT)
|
||||
query_text += "int(11)";
|
||||
query_text += "int";
|
||||
else
|
||||
query_text += "text";
|
||||
}
|
||||
query_text += ", PRIMARY KEY (`id`), KEY `timestamp_idx` (`timestamp`))";
|
||||
query_text += ", PRIMARY KEY (`id`), KEY `timestamp_idx` (`timestamp`)) ROW_FORMAT=DYNAMIC";
|
||||
queries.push_back(query_text);
|
||||
}
|
||||
else
|
||||
@@ -428,7 +433,7 @@ std::vector<Query> MySQLService::CreateTable(const Anope::string &table, const D
|
||||
|
||||
Anope::string query_text = "ALTER TABLE `" + table + "` ADD `" + column + "` ";
|
||||
if (data.GetType(column) == Serialize::Data::DT_INT)
|
||||
query_text += "int(11)";
|
||||
query_text += "int";
|
||||
else
|
||||
query_text += "text";
|
||||
|
||||
|
||||
+7
-7
@@ -17,7 +17,7 @@ class CommandBSSetFantasy final
|
||||
public:
|
||||
CommandBSSetFantasy(Module *creator, const Anope::string &sname = "botserv/set/fantasy") : Command(creator, sname, 2, 2)
|
||||
{
|
||||
this->SetDesc(_("Enable fantaisist commands"));
|
||||
this->SetDesc(_("Enable fantasy commands"));
|
||||
this->SetSyntax(_("\037channel\037 {\037ON|OFF\037}"));
|
||||
}
|
||||
|
||||
@@ -73,9 +73,9 @@ public:
|
||||
"fantasy commands on a channel when prefixed\n"
|
||||
"with one of the following fantasy characters: \002%s\002\n"
|
||||
" \n"
|
||||
"Note that users wanting to use fantaisist\n"
|
||||
"commands MUST have enough access for both\n"
|
||||
"the FANTASIA and the command they are executing."),
|
||||
"Note that users wanting to use fantasy commands\n"
|
||||
"MUST have enough access for both the FANTASY\n"
|
||||
"privilege and the command they are executing."),
|
||||
Config->GetModule(this->owner)->Get<const Anope::string>("fantasycharacter", "!").c_str());
|
||||
return true;
|
||||
}
|
||||
@@ -186,10 +186,10 @@ public:
|
||||
source.permission = info.permission;
|
||||
|
||||
AccessGroup ag = c->ci->AccessFor(u);
|
||||
bool has_fantasia = ag.HasPriv("FANTASIA") || source.HasPriv("botserv/fantasy");
|
||||
bool has_fantasy = ag.HasPriv("FANTASY") || source.HasPriv("botserv/fantasy");
|
||||
|
||||
EventReturn MOD_RESULT;
|
||||
if (has_fantasia)
|
||||
if (has_fantasy)
|
||||
{
|
||||
FOREACH_RESULT(OnBotFantasy, MOD_RESULT, (source, cmd, c->ci, params));
|
||||
}
|
||||
@@ -198,7 +198,7 @@ public:
|
||||
FOREACH_RESULT(OnBotNoFantasyAccess, MOD_RESULT, (source, cmd, c->ci, params));
|
||||
}
|
||||
|
||||
if (MOD_RESULT == EVENT_STOP || !has_fantasia)
|
||||
if (MOD_RESULT == EVENT_STOP || !has_fantasy)
|
||||
return;
|
||||
|
||||
if (MOD_RESULT != EVENT_ALLOW && !info.permission.empty() && !source.HasCommand(info.permission))
|
||||
|
||||
@@ -153,9 +153,9 @@ public:
|
||||
}
|
||||
|
||||
if (server)
|
||||
this->ServerGlobal(sender, Servers::GetUplink(), true, line);
|
||||
else
|
||||
this->ServerGlobal(sender, server, false, line);
|
||||
else
|
||||
this->ServerGlobal(sender, Servers::GetUplink(), true, line);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -198,7 +198,8 @@ public:
|
||||
Anope::string *greet = ns_greet.Get(user->Account());
|
||||
if (bs_greet.HasExt(c->ci) && greet != NULL && !greet->empty() && c->FindUser(c->ci->bi) && c->ci->AccessFor(user).HasPriv("GREET"))
|
||||
{
|
||||
IRCD->SendPrivmsg(*c->ci->bi, c->name, "[%s] %s", user->Account()->display.c_str(), greet->c_str());
|
||||
const auto message = Anope::printf("[%s] %s", user->Account()->display.c_str(), greet->c_str());
|
||||
IRCD->SendPrivmsg(*c->ci->bi, c->name, message);
|
||||
c->ci->bi->lastmsg = Anope::CurTime;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
|
||||
const NickAlias *na = NickAlias::Find(u->nick);
|
||||
if (!na || na->nc != u->Account() || !na->HasVHost())
|
||||
na = NickAlias::Find(u->Account()->display);
|
||||
na = u->AccountNick();
|
||||
if (!na || !na->HasVHost())
|
||||
return;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
|
||||
const NickAlias *na = NickAlias::Find(u->nick);
|
||||
if (!na || na->nc != u->Account() || !na->HasVHost())
|
||||
na = NickAlias::Find(u->Account()->display);
|
||||
na = u->AccountNick();
|
||||
|
||||
if (!na || !na->HasVHost())
|
||||
source.Reply(HOST_NOT_ASSIGNED);
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
User *u = source.GetUser();
|
||||
const NickAlias *na = NickAlias::Find(u->nick);
|
||||
if (!na || na->nc != u->Account() || !na->HasVHost())
|
||||
na = NickAlias::Find(u->Account()->display);
|
||||
na = u->AccountNick();
|
||||
if (na && u->Account() == na->nc && na->HasVHost())
|
||||
{
|
||||
source.Reply(_("Your vhost of \002%s\002 is now activated."), na->GetVHostMask().c_str());
|
||||
|
||||
+19
-20
@@ -117,7 +117,7 @@ void IRC2SQL::OnUserConnect(User *u, bool &exempt)
|
||||
this->RunQuery(query);
|
||||
|
||||
if (ctcpuser && (Me->IsSynced() || ctcpeob) && u->server != Me)
|
||||
IRCD->SendPrivmsg(StatServ, u->GetUID(), "\1VERSION\1");
|
||||
IRCD->SendPrivmsg(StatServ, u->GetUID(), Anope::FormatCTCP("VERSION"));
|
||||
|
||||
}
|
||||
|
||||
@@ -299,28 +299,27 @@ void IRC2SQL::OnTopicUpdated(User *source, Channel *c, const Anope::string &user
|
||||
|
||||
void IRC2SQL::OnBotNotice(User *u, BotInfo *bi, Anope::string &message, const Anope::map<Anope::string> &tags)
|
||||
{
|
||||
Anope::string versionstr;
|
||||
if (bi != StatServ)
|
||||
return;
|
||||
if (message[0] == '\1' && message[message.length() - 1] == '\1')
|
||||
{
|
||||
if (message.substr(0, 9).equals_ci("\1VERSION "))
|
||||
{
|
||||
if (u->HasExt("CTCPVERSION"))
|
||||
return;
|
||||
u->Extend<bool>("CTCPVERSION");
|
||||
|
||||
versionstr = Anope::NormalizeBuffer(message.substr(9, message.length() - 10));
|
||||
if (versionstr.empty())
|
||||
return;
|
||||
query = "UPDATE `" + prefix + "user` "
|
||||
"SET version=@version@ "
|
||||
"WHERE nick=@nick@";
|
||||
query.SetValue("version", versionstr);
|
||||
query.SetValue("nick", u->nick);
|
||||
this->RunQuery(query);
|
||||
}
|
||||
}
|
||||
Anope::string ctcpname, ctcpbody;
|
||||
if (!Anope::ParseCTCP(message, ctcpname, ctcpbody) || ctcpname != "VERSION")
|
||||
return;
|
||||
|
||||
if (u->HasExt("CTCPVERSION"))
|
||||
return;
|
||||
|
||||
u->Extend<bool>("CTCPVERSION");
|
||||
auto versionstr = Anope::NormalizeBuffer(message.substr(9, message.length() - 10));
|
||||
if (versionstr.empty())
|
||||
return;
|
||||
|
||||
query = "UPDATE `" + prefix + "user` "
|
||||
"SET version=@version@ "
|
||||
"WHERE nick=@nick@";
|
||||
query.SetValue("version", versionstr);
|
||||
query.SetValue("nick", u->nick);
|
||||
this->RunQuery(query);
|
||||
}
|
||||
|
||||
MODULE_INIT(IRC2SQL)
|
||||
|
||||
@@ -26,6 +26,17 @@ struct CertServiceImpl final
|
||||
return it->second;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void ReplaceCert(const Anope::string &oldcert, const Anope::string &newcert) override
|
||||
{
|
||||
auto *nc = FindAccountFromCert(oldcert);
|
||||
if (!nc)
|
||||
return;
|
||||
|
||||
auto *cl = nc->GetExt<NSCertList>("certificates");
|
||||
if (cl)
|
||||
cl->ReplaceCert(oldcert, newcert);
|
||||
}
|
||||
};
|
||||
|
||||
struct NSCertListImpl final
|
||||
@@ -405,6 +416,15 @@ public:
|
||||
Log(NickServ) << u->GetMask() << " automatically identified for account " << nc->display << " via SSL certificate fingerprint";
|
||||
}
|
||||
|
||||
void OnNickRegister(User *u, NickAlias *na, const Anope::string &pass) override
|
||||
{
|
||||
if (!Config->GetModule(this)->Get<bool>("automatic", "yes") || !u || u->fingerprint.empty())
|
||||
return;
|
||||
|
||||
auto *cl = certs.Require(na->nc);
|
||||
cl->AddCert(u->fingerprint);
|
||||
}
|
||||
|
||||
EventReturn OnNickValidate(User *u, NickAlias *na) override
|
||||
{
|
||||
NSCertList *cl = certs.Get(na->nc);
|
||||
|
||||
@@ -24,8 +24,35 @@ public:
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override
|
||||
{
|
||||
Anope::string nick;
|
||||
if (params.empty())
|
||||
{
|
||||
// Use the display of the source if logged in; otherwise, use their nick.
|
||||
nick = source.nc ? source.nc->na->nick : source.GetNick();
|
||||
}
|
||||
else if (params[0][0] == '=' && params[0].length() > 1)
|
||||
{
|
||||
// Look up the account of the specified user.
|
||||
nick = params[0].substr(1);
|
||||
auto *u = User::Find(nick);
|
||||
if (!u)
|
||||
{
|
||||
source.Reply(NICK_X_NOT_IN_USE, nick.c_str());
|
||||
return;
|
||||
}
|
||||
if (!u->AccountNick())
|
||||
{
|
||||
source.Reply(_("User \002%s\002 isn't currently logged in to an account."), nick.c_str());
|
||||
return;
|
||||
}
|
||||
nick = u->AccountNick()->nick;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Just use the nick the user specified.
|
||||
nick = params[0];
|
||||
}
|
||||
|
||||
const Anope::string &nick = params.size() ? params[0] : (source.nc ? source.nc->display : source.GetNick());
|
||||
NickAlias *na = NickAlias::Find(nick);
|
||||
bool has_auspex = source.HasPriv("nickserv/auspex");
|
||||
|
||||
@@ -88,7 +115,8 @@ public:
|
||||
info[_("Last seen address")] = na->last_realhost;
|
||||
}
|
||||
|
||||
info[_("Registered")] = Anope::strftime(na->time_registered, source.GetAccount());
|
||||
info[_("Account registered")] = Anope::strftime(na->nc->time_registered, source.GetAccount());
|
||||
info[_("Nick registered")] = Anope::strftime(na->time_registered, source.GetAccount());
|
||||
|
||||
if (!nick_online)
|
||||
info[_("Last seen")] = Anope::strftime(na->last_seen, source.GetAccount());
|
||||
|
||||
@@ -401,7 +401,7 @@ public:
|
||||
u->SendMessage(NickServ, _("All new accounts must be validated by an administrator. Please wait for your registration to be confirmed."));
|
||||
else
|
||||
u->SendMessage(NickServ, _("Your email address is not confirmed. To confirm it, follow the instructions that were emailed to you."));
|
||||
const NickAlias *this_na = NickAlias::Find(u->Account()->display);
|
||||
const NickAlias *this_na = u->AccountNick();
|
||||
time_t time_registered = Anope::CurTime - this_na->time_registered;
|
||||
time_t unconfirmed_expire = Config->GetModule(this)->Get<time_t>("unconfirmedexpire", "1d");
|
||||
if (unconfirmed_expire > time_registered)
|
||||
|
||||
+2
-119
@@ -892,120 +892,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class CommandNSSetLanguage
|
||||
: public Command
|
||||
{
|
||||
public:
|
||||
CommandNSSetLanguage(Module *creator, const Anope::string &sname = "nickserv/set/language", size_t min = 1) : Command(creator, sname, min, min + 1)
|
||||
{
|
||||
this->SetDesc(_("Set the language services will use when messaging you"));
|
||||
this->SetSyntax(_("\037language\037"));
|
||||
}
|
||||
|
||||
void Run(CommandSource &source, const Anope::string &user, const Anope::string ¶m)
|
||||
{
|
||||
if (Anope::ReadOnly)
|
||||
{
|
||||
source.Reply(READ_ONLY_MODE);
|
||||
return;
|
||||
}
|
||||
|
||||
const NickAlias *na = NickAlias::Find(user);
|
||||
if (!na)
|
||||
{
|
||||
source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
|
||||
return;
|
||||
}
|
||||
NickCore *nc = na->nc;
|
||||
|
||||
EventReturn MOD_RESULT;
|
||||
FOREACH_RESULT(OnSetNickOption, MOD_RESULT, (source, this, nc, param));
|
||||
if (MOD_RESULT == EVENT_STOP)
|
||||
return;
|
||||
|
||||
if (param != "en_US")
|
||||
for (unsigned j = 0; j < Language::Languages.size(); ++j)
|
||||
{
|
||||
if (Language::Languages[j] == param)
|
||||
break;
|
||||
else if (j + 1 == Language::Languages.size())
|
||||
{
|
||||
this->OnSyntaxError(source, "");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to change the language of " << nc->display << " to " << param;
|
||||
|
||||
nc->language = param;
|
||||
if (source.GetAccount() == nc)
|
||||
source.Reply(_("Language changed to \002English\002."));
|
||||
else
|
||||
source.Reply(_("Language for \002%s\002 changed to \002%s\002."), nc->display.c_str(), Language::Translate(param.c_str(), _("English")));
|
||||
}
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶m) override
|
||||
{
|
||||
this->Run(source, source.nc->display, param[0]);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &) override
|
||||
{
|
||||
this->SendSyntax(source);
|
||||
source.Reply(" ");
|
||||
source.Reply(_("Changes the language services uses when sending messages to\n"
|
||||
"you (for example, when responding to a command you send).\n"
|
||||
"\037language\037 should be chosen from the following list of\n"
|
||||
"supported languages:"));
|
||||
|
||||
source.Reply(" en_US (English)");
|
||||
for (const auto &language : Language::Languages)
|
||||
{
|
||||
const Anope::string &langname = Language::Translate(language.c_str(), _("English"));
|
||||
if (langname == "English")
|
||||
continue;
|
||||
source.Reply(" %s (%s)", language.c_str(), langname.c_str());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class CommandNSSASetLanguage final
|
||||
: public CommandNSSetLanguage
|
||||
{
|
||||
public:
|
||||
CommandNSSASetLanguage(Module *creator) : CommandNSSetLanguage(creator, "nickserv/saset/language", 2)
|
||||
{
|
||||
this->ClearSyntax();
|
||||
this->SetSyntax(_("\037nickname\037 \037language\037"));
|
||||
}
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override
|
||||
{
|
||||
this->Run(source, params[0], params[1]);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &) override
|
||||
{
|
||||
this->SendSyntax(source);
|
||||
source.Reply(" ");
|
||||
source.Reply(_("Changes the language services uses when sending messages to\n"
|
||||
"the given user (for example, when responding to a command they send).\n"
|
||||
"\037language\037 should be chosen from the following list of\n"
|
||||
"supported languages:"));
|
||||
source.Reply(" en (English)");
|
||||
for (const auto &language : Language::Languages)
|
||||
{
|
||||
const Anope::string &langname = Language::Translate(language.c_str(), _("English"));
|
||||
if (langname == "English")
|
||||
continue;
|
||||
source.Reply(" %s (%s)", language.c_str(), langname.c_str());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class CommandNSSetMessage
|
||||
: public Command
|
||||
{
|
||||
@@ -1189,9 +1075,6 @@ class NSSet final
|
||||
CommandNSSetKill commandnssetkill;
|
||||
CommandNSSASetKill commandnssasetkill;
|
||||
|
||||
CommandNSSetLanguage commandnssetlanguage;
|
||||
CommandNSSASetLanguage commandnssasetlanguage;
|
||||
|
||||
CommandNSSetMessage commandnssetmessage;
|
||||
CommandNSSASetMessage commandnssasetmessage;
|
||||
|
||||
@@ -1262,7 +1145,6 @@ public:
|
||||
commandnssetemail(this), commandnssasetemail(this),
|
||||
commandnssetkeepmodes(this), commandnssasetkeepmodes(this),
|
||||
commandnssetkill(this), commandnssasetkill(this),
|
||||
commandnssetlanguage(this), commandnssasetlanguage(this),
|
||||
commandnssetmessage(this), commandnssasetmessage(this),
|
||||
commandnssetpassword(this), commandnssasetpassword(this),
|
||||
commandnssasetnoexpire(this),
|
||||
@@ -1354,7 +1236,8 @@ public:
|
||||
{
|
||||
if (keep_modes.HasExt(u->Account()))
|
||||
{
|
||||
for (const auto &[last_mode, last_value] : u->Account()->last_modes)
|
||||
User::ModeList modes = u->Account()->last_modes;
|
||||
for (const auto &[last_mode, last_value] : modes)
|
||||
{
|
||||
UserMode *um = ModeManager::FindUserModeByName(last_mode);
|
||||
/* if the null user can set the mode, then it's probably safe */
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
/* NickServ core functions
|
||||
*
|
||||
* (C) 2003-2024 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#include "module.h"
|
||||
|
||||
class CommandNSSetLanguage
|
||||
: public Command
|
||||
{
|
||||
public:
|
||||
CommandNSSetLanguage(Module *creator, const Anope::string &sname = "nickserv/set/language", size_t min = 1)
|
||||
: Command(creator, sname, min, min + 1)
|
||||
{
|
||||
this->SetDesc(_("Set the language services will use when messaging you"));
|
||||
this->SetSyntax(_("\037language\037"));
|
||||
}
|
||||
|
||||
void Run(CommandSource &source, const Anope::string &user, const Anope::string ¶m)
|
||||
{
|
||||
if (Anope::ReadOnly)
|
||||
{
|
||||
source.Reply(READ_ONLY_MODE);
|
||||
return;
|
||||
}
|
||||
|
||||
const NickAlias *na = NickAlias::Find(user);
|
||||
if (!na)
|
||||
{
|
||||
source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
|
||||
return;
|
||||
}
|
||||
NickCore *nc = na->nc;
|
||||
|
||||
EventReturn MOD_RESULT;
|
||||
FOREACH_RESULT(OnSetNickOption, MOD_RESULT, (source, this, nc, param));
|
||||
if (MOD_RESULT == EVENT_STOP)
|
||||
return;
|
||||
|
||||
if (param != "en_US")
|
||||
{
|
||||
for (unsigned j = 0; j < Language::Languages.size(); ++j)
|
||||
{
|
||||
if (Language::Languages[j] == param)
|
||||
break;
|
||||
else if (j + 1 == Language::Languages.size())
|
||||
{
|
||||
this->OnSyntaxError(source, "");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to change the language of " << nc->display << " to " << param;
|
||||
|
||||
nc->language = param;
|
||||
if (source.GetAccount() == nc)
|
||||
source.Reply(_("Language changed to \002English\002."));
|
||||
else
|
||||
source.Reply(_("Language for \002%s\002 changed to \002%s\002."), nc->display.c_str(), Language::Translate(param.c_str(), _("English")));
|
||||
}
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶m) override
|
||||
{
|
||||
this->Run(source, source.nc->display, param[0]);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &) override
|
||||
{
|
||||
this->SendSyntax(source);
|
||||
source.Reply(" ");
|
||||
source.Reply(_("Changes the language services uses when sending messages to\n"
|
||||
"you (for example, when responding to a command you send).\n"
|
||||
"\037language\037 should be chosen from the following list of\n"
|
||||
"supported languages:"));
|
||||
|
||||
source.Reply(" en_US (English)");
|
||||
for (const auto &language : Language::Languages)
|
||||
{
|
||||
const Anope::string &langname = Language::Translate(language.c_str(), _("English"));
|
||||
if (langname != "English")
|
||||
source.Reply(" %s (%s)", language.c_str(), langname.c_str());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class CommandNSSASetLanguage final
|
||||
: public CommandNSSetLanguage
|
||||
{
|
||||
public:
|
||||
CommandNSSASetLanguage(Module *creator)
|
||||
: CommandNSSetLanguage(creator, "nickserv/saset/language", 2)
|
||||
{
|
||||
this->ClearSyntax();
|
||||
this->SetSyntax(_("\037nickname\037 \037language\037"));
|
||||
}
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override
|
||||
{
|
||||
this->Run(source, params[0], params[1]);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &) override
|
||||
{
|
||||
this->SendSyntax(source);
|
||||
source.Reply(" ");
|
||||
source.Reply(_("Changes the language services uses when sending messages to\n"
|
||||
"the given user (for example, when responding to a command they send).\n"
|
||||
"\037language\037 should be chosen from the following list of\n"
|
||||
"supported languages:"));
|
||||
source.Reply(" en_US (English)");
|
||||
for (const auto &language : Language::Languages)
|
||||
{
|
||||
const Anope::string &langname = Language::Translate(language.c_str(), _("English"));
|
||||
if (langname != "English")
|
||||
source.Reply(" %s (%s)", language.c_str(), langname.c_str());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class NSSetLanguage final
|
||||
: public Module
|
||||
{
|
||||
private:
|
||||
CommandNSSetLanguage commandnssetlanguage;
|
||||
CommandNSSASetLanguage commandnssasetlanguage;
|
||||
|
||||
public:
|
||||
NSSetLanguage(const Anope::string &modname, const Anope::string &creator)
|
||||
: Module(modname, creator, VENDOR)
|
||||
, commandnssetlanguage(this)
|
||||
, commandnssasetlanguage(this)
|
||||
{
|
||||
#ifndef HAVE_LOCALIZATION
|
||||
throw ModuleException("Anope was not built with localization support");
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
MODULE_INIT(NSSetLanguage)
|
||||
@@ -128,6 +128,8 @@ public:
|
||||
User *u2 = User::Find(na2->nick, true);
|
||||
if (u2)
|
||||
{
|
||||
IRCD->SendLogout(u2);
|
||||
u2->RemoveMode(source.service, "REGISTERED");
|
||||
u2->Logout();
|
||||
if (nickserv)
|
||||
nickserv->Collide(u2, na2);
|
||||
|
||||
@@ -188,7 +188,10 @@ private:
|
||||
}
|
||||
|
||||
if (!akills->CanAdd(source, mask, expires, reason))
|
||||
{
|
||||
delete x;
|
||||
return;
|
||||
}
|
||||
|
||||
EventReturn MOD_RESULT;
|
||||
FOREACH_RESULT(OnAddXLine, MOD_RESULT, (source, x, akills));
|
||||
|
||||
@@ -532,7 +532,7 @@ public:
|
||||
|
||||
EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) override
|
||||
{
|
||||
if (command->name == "nickserv/info" && params.size() > 0)
|
||||
if (command->name == "nickserv/info" && !params.empty() && params[0][0] != '=')
|
||||
{
|
||||
ForbidData *d = this->forbidService.FindForbid(params[0], FT_NICK);
|
||||
if (d != NULL)
|
||||
|
||||
@@ -10,43 +10,7 @@
|
||||
*/
|
||||
|
||||
#include "module.h"
|
||||
|
||||
struct MyOper final
|
||||
: Oper
|
||||
, Serializable
|
||||
{
|
||||
MyOper(const Anope::string &n, OperType *o) : Oper(n, o), Serializable("Oper") { }
|
||||
|
||||
void Serialize(Serialize::Data &data) const override
|
||||
{
|
||||
data["name"] << this->name;
|
||||
data["type"] << this->ot->GetName();
|
||||
}
|
||||
|
||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
{
|
||||
Anope::string stype, sname;
|
||||
|
||||
data["type"] >> stype;
|
||||
data["name"] >> sname;
|
||||
|
||||
OperType *ot = OperType::Find(stype);
|
||||
if (ot == NULL)
|
||||
return NULL;
|
||||
NickCore *nc = NickCore::Find(sname);
|
||||
if (nc == NULL)
|
||||
return NULL;
|
||||
|
||||
MyOper *myo;
|
||||
if (obj)
|
||||
myo = anope_dynamic_static_cast<MyOper *>(obj);
|
||||
else
|
||||
myo = new MyOper(nc->display, ot);
|
||||
nc->o = myo;
|
||||
Log(LOG_NORMAL, "operserv/oper") << "Tied oper " << nc->display << " to type " << ot->GetName();
|
||||
return myo;
|
||||
}
|
||||
};
|
||||
#include "modules/os_oper.h"
|
||||
|
||||
class CommandOSOper final
|
||||
: public Command
|
||||
|
||||
@@ -389,7 +389,10 @@ class CommandOSSNLine final
|
||||
}
|
||||
|
||||
if (!this->xlm()->CanAdd(source, mask, expires, reason))
|
||||
{
|
||||
delete x;
|
||||
return;
|
||||
}
|
||||
|
||||
EventReturn MOD_RESULT;
|
||||
FOREACH_RESULT(OnAddXLine, MOD_RESULT, (source, x, this->xlm()));
|
||||
|
||||
@@ -711,8 +711,6 @@ class ProtoHybrid final
|
||||
IRCDMessageTMode message_tmode;
|
||||
IRCDMessageUID message_uid;
|
||||
|
||||
bool use_server_side_mlock;
|
||||
|
||||
static void AddModes()
|
||||
{
|
||||
/* Add user modes */
|
||||
@@ -819,18 +817,13 @@ public:
|
||||
u->RemoveModeInternal(Me, ModeManager::FindUserModeByName("REGISTERED"));
|
||||
}
|
||||
|
||||
void OnReload(Configuration::Conf *conf) override
|
||||
{
|
||||
use_server_side_mlock = conf->GetModule(this)->Get<bool>("use_server_side_mlock");
|
||||
}
|
||||
|
||||
void OnChannelSync(Channel *c) override
|
||||
{
|
||||
if (!c->ci)
|
||||
return;
|
||||
|
||||
ModeLocks *modelocks = c->ci->GetExt<ModeLocks>("modelocks");
|
||||
if (use_server_side_mlock && modelocks && Servers::Capab.count("MLOCK"))
|
||||
if (modelocks && Servers::Capab.count("MLOCK"))
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "");
|
||||
Uplink::Send("MLOCK", c->creation_time, c->ci->name, Anope::CurTime, modes);
|
||||
@@ -839,7 +832,7 @@ public:
|
||||
|
||||
void OnDelChan(ChannelInfo *ci) override
|
||||
{
|
||||
if (use_server_side_mlock && ci->c && Servers::Capab.count("MLOCK"))
|
||||
if (ci->c && Servers::Capab.count("MLOCK"))
|
||||
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, Anope::CurTime, "");
|
||||
}
|
||||
|
||||
@@ -847,7 +840,7 @@ public:
|
||||
{
|
||||
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
|
||||
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
|
||||
if (use_server_side_mlock && cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK"))
|
||||
if (cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK"))
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "") + cm->mchar;
|
||||
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, Anope::CurTime, modes);
|
||||
@@ -860,7 +853,7 @@ public:
|
||||
{
|
||||
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
|
||||
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
|
||||
if (use_server_side_mlock && cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK"))
|
||||
if (cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK"))
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "").replace_all_cs(cm->mchar, "");
|
||||
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, Anope::CurTime, modes);
|
||||
|
||||
@@ -10,9 +10,10 @@
|
||||
*/
|
||||
|
||||
#include "module.h"
|
||||
#include "modules/encryption.h"
|
||||
#include "modules/cs_mode.h"
|
||||
#include "modules/encryption.h"
|
||||
#include "modules/httpd.h"
|
||||
#include "modules/ns_cert.h"
|
||||
#include "modules/sasl.h"
|
||||
|
||||
typedef std::map<char, unsigned> ListLimits;
|
||||
@@ -144,7 +145,6 @@ public:
|
||||
CanSetVIdent = true;
|
||||
CanSQLine = true;
|
||||
CanSZLine = true;
|
||||
CanSVSLogout = true;
|
||||
CanCertFP = true;
|
||||
RequiresID = true;
|
||||
MaxModes = 0;
|
||||
@@ -207,7 +207,7 @@ public:
|
||||
{
|
||||
if (spanningtree_proto_ver >= 1206)
|
||||
{
|
||||
IRCD->SendNoticeInternal(bi, target->GetUID(), msg, {
|
||||
IRCD->SendNotice(bi, target->GetUID(), msg, {
|
||||
{ "~context", context->name },
|
||||
});
|
||||
return;
|
||||
@@ -219,7 +219,7 @@ public:
|
||||
{
|
||||
if (spanningtree_proto_ver >= 1206)
|
||||
{
|
||||
IRCD->SendPrivmsgInternal(bi, target->GetUID(), msg, {
|
||||
IRCD->SendPrivmsg(bi, target->GetUID(), msg, {
|
||||
{ "~context", context->name },
|
||||
});
|
||||
return;
|
||||
@@ -1147,6 +1147,7 @@ struct IRCDMessageCapab final
|
||||
IRCD->CanClearBans = false;
|
||||
IRCD->CanSQLineChannel = false;
|
||||
IRCD->CanSVSHold = false;
|
||||
IRCD->CanTagMessage = false;
|
||||
IRCD->DefaultPseudoclientModes = "+oI";
|
||||
}
|
||||
else if (params[0].equals_cs("CHANMODES") && params.size() > 1)
|
||||
@@ -1523,6 +1524,9 @@ struct IRCDMessageCapab final
|
||||
|
||||
else if (modname.equals_cs("chgident"))
|
||||
Servers::Capab.insert("CHGIDENT");
|
||||
|
||||
else if (modname.equals_cs("ircv3_ctctags"))
|
||||
IRCD->CanTagMessage = true;
|
||||
}
|
||||
|
||||
const auto &anoperegex = Config->GetBlock("options")->Get<const Anope::string>("regexengine");
|
||||
@@ -1583,6 +1587,9 @@ struct IRCDMessageCapab final
|
||||
if (!IRCD->CanSQLineChannel)
|
||||
Log() << "The remote server does not have the cban module; services will manually enforce forbidden channels until the module is loaded.";
|
||||
|
||||
if (!IRCD->CanTagMessage)
|
||||
Log() << "The remote server does not have the ircv3_ctctags module; sending tag messages is disabled until the module is loaded.";
|
||||
|
||||
if (!Servers::Capab.count("CHGHOST"))
|
||||
Log() << "The remote server does not have the chghost module; vhosts are disabled until the module is loaded.";
|
||||
|
||||
@@ -1805,12 +1812,20 @@ struct IRCDMessageSave final
|
||||
class IRCDMessageMetadata final
|
||||
: IRCDMessage
|
||||
{
|
||||
const bool &do_topiclock;
|
||||
const bool &do_mlock;
|
||||
private:
|
||||
ServiceReference<CertService> certs;
|
||||
PrimitiveExtensibleItem<ListLimits> &maxlist;
|
||||
|
||||
|
||||
public:
|
||||
IRCDMessageMetadata(Module *creator, const bool &handle_topiclock, const bool &handle_mlock, PrimitiveExtensibleItem<ListLimits> &listlimits) : IRCDMessage(creator, "METADATA", 3), do_topiclock(handle_topiclock), do_mlock(handle_mlock), maxlist(listlimits) { SetFlag(FLAG_REQUIRE_SERVER); SetFlag(FLAG_SOFT_LIMIT); }
|
||||
IRCDMessageMetadata(Module *creator, PrimitiveExtensibleItem<ListLimits> &listlimits)
|
||||
: IRCDMessage(creator, "METADATA", 3)
|
||||
, certs("CertService", "certs")
|
||||
, maxlist(listlimits)
|
||||
{
|
||||
SetFlag(FLAG_REQUIRE_SERVER);
|
||||
SetFlag(FLAG_SOFT_LIMIT);
|
||||
}
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override
|
||||
{
|
||||
@@ -1822,7 +1837,7 @@ public:
|
||||
Channel *c = Channel::Find(params[0]);
|
||||
if (c)
|
||||
{
|
||||
if ((c->ci) && (do_mlock) && (params[2] == "mlock"))
|
||||
if (c->ci && params[2] == "mlock")
|
||||
{
|
||||
ModeLocks *modelocks = c->ci->GetExt<ModeLocks>("modelocks");
|
||||
Anope::string modes;
|
||||
@@ -1833,7 +1848,7 @@ public:
|
||||
if (modes != params[3])
|
||||
Uplink::Send("METADATA", c->name, c->creation_time, "mlock", modes);
|
||||
}
|
||||
else if ((c->ci) && (do_topiclock) && (params[2] == "topiclock"))
|
||||
else if (c->ci && params[2] == "topiclock")
|
||||
{
|
||||
bool mystate = c->ci->HasExt("TOPICLOCK");
|
||||
bool serverstate = (params[3] == "1");
|
||||
@@ -1855,12 +1870,12 @@ public:
|
||||
}
|
||||
else if (isdigit(params[0][0]))
|
||||
{
|
||||
auto *u = User::Find(params[0]);
|
||||
if (!u)
|
||||
return;
|
||||
|
||||
if (params[1].equals_cs("accountname"))
|
||||
{
|
||||
User *u = User::Find(params[0]);
|
||||
if (!u)
|
||||
return; // Should never happen.
|
||||
|
||||
if (params[2].empty())
|
||||
{
|
||||
// The user has been logged out by the IRC server.
|
||||
@@ -1883,18 +1898,22 @@ public:
|
||||
*/
|
||||
else if (params[1].equals_cs("ssl_cert"))
|
||||
{
|
||||
User *u = User::Find(params[0]);
|
||||
if (!u)
|
||||
return;
|
||||
u->Extend<bool>("ssl");
|
||||
Anope::string data = params[2].c_str();
|
||||
size_t pos1 = data.find(' ') + 1;
|
||||
size_t pos2 = data.find(' ', pos1);
|
||||
if ((pos2 - pos1) >= 32) // inspircd supports md5 and sha1 fingerprint hashes -> size 32 or 40 bytes.
|
||||
{
|
||||
u->fingerprint = data.substr(pos1, pos2 - pos1);
|
||||
}
|
||||
|
||||
Anope::string data;
|
||||
spacesepstream tokens(params[2]);
|
||||
if (!tokens.GetToken(data) || data.find('E') != Anope::string::npos || !tokens.GetToken(data))
|
||||
return; // Malformed or no client certificate.
|
||||
|
||||
commasepstream fingerprints(data);
|
||||
if (!fingerprints.GetToken(data))
|
||||
return; // Should never happen?
|
||||
|
||||
u->fingerprint = data;
|
||||
FOREACH_MOD(OnFingerprint, (u));
|
||||
|
||||
while (certs && fingerprints.GetToken(data))
|
||||
certs->ReplaceCert(data, u->fingerprint);
|
||||
}
|
||||
}
|
||||
else if (params[0] == "*")
|
||||
@@ -1942,6 +1961,9 @@ public:
|
||||
else if (modname.equals_cs("hidechans"))
|
||||
required = true;
|
||||
|
||||
else if (modname.equals_cs("ircv3_ctctags"))
|
||||
IRCD->CanTagMessage = plus;
|
||||
|
||||
else if (modname.equals_cs("rline"))
|
||||
capab = "RLINE";
|
||||
|
||||
@@ -2437,8 +2459,6 @@ class ProtoInspIRCd final
|
||||
IRCDMessageSQuit message_squit;
|
||||
IRCDMessageUID message_uid;
|
||||
|
||||
bool use_server_side_topiclock, use_server_side_mlock;
|
||||
|
||||
static void SendChannelMetadata(Channel *c, const Anope::string &metadataname, const Anope::string &value)
|
||||
{
|
||||
Uplink::Send("METADATA", c->name, c->creation_time, metadataname, value);
|
||||
@@ -2475,7 +2495,7 @@ public:
|
||||
, message_ijoin(this)
|
||||
, message_kick(this)
|
||||
, message_lmode(this)
|
||||
, message_metadata(this, use_server_side_topiclock, use_server_side_mlock, ircd_proto.maxlist)
|
||||
, message_metadata(this, ircd_proto.maxlist)
|
||||
, message_mode(this)
|
||||
, message_nick(this)
|
||||
, message_opertype(this)
|
||||
@@ -2489,12 +2509,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void OnReload(Configuration::Conf *conf) override
|
||||
{
|
||||
use_server_side_topiclock = conf->GetModule(this)->Get<bool>("use_server_side_topiclock");
|
||||
use_server_side_mlock = conf->GetModule(this)->Get<bool>("use_server_side_mlock");
|
||||
}
|
||||
|
||||
void OnUserNickChange(User *u, const Anope::string &) override
|
||||
{
|
||||
u->RemoveModeInternal(Me, ModeManager::FindUserModeByName("REGISTERED"));
|
||||
@@ -2509,13 +2523,13 @@ public:
|
||||
void OnChanRegistered(ChannelInfo *ci) override
|
||||
{
|
||||
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
|
||||
if (use_server_side_mlock && ci->c && modelocks && !modelocks->GetMLockAsString(false).empty())
|
||||
if (ci->c && modelocks && !modelocks->GetMLockAsString(false).empty())
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "");
|
||||
SendChannelMetadata(ci->c, "mlock", modes);
|
||||
}
|
||||
|
||||
if (use_server_side_topiclock && Servers::Capab.count("TOPICLOCK") && ci->c)
|
||||
if (Servers::Capab.count("TOPICLOCK") && ci->c)
|
||||
{
|
||||
if (ci->HasExt("TOPICLOCK"))
|
||||
SendChannelMetadata(ci->c, "topiclock", "1");
|
||||
@@ -2524,10 +2538,11 @@ public:
|
||||
|
||||
void OnDelChan(ChannelInfo *ci) override
|
||||
{
|
||||
if (use_server_side_mlock && ci->c)
|
||||
SendChannelMetadata(ci->c, "mlock", "");
|
||||
if (!ci->c)
|
||||
return;
|
||||
|
||||
if (use_server_side_topiclock && Servers::Capab.count("TOPICLOCK") && ci->c)
|
||||
SendChannelMetadata(ci->c, "mlock", "");
|
||||
if (Servers::Capab.count("TOPICLOCK"))
|
||||
SendChannelMetadata(ci->c, "topiclock", "");
|
||||
}
|
||||
|
||||
@@ -2535,7 +2550,7 @@ public:
|
||||
{
|
||||
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
|
||||
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
|
||||
if (use_server_side_mlock && cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM))
|
||||
if (cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM))
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "") + cm->mchar;
|
||||
SendChannelMetadata(ci->c, "mlock", modes);
|
||||
@@ -2548,7 +2563,7 @@ public:
|
||||
{
|
||||
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
|
||||
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
|
||||
if (use_server_side_mlock && cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM))
|
||||
if (cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM))
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "").replace_all_cs(cm->mchar, "");
|
||||
SendChannelMetadata(ci->c, "mlock", modes);
|
||||
|
||||
@@ -187,7 +187,15 @@ public:
|
||||
void SendSVSLogin(const Anope::string &uid, NickAlias *na) override
|
||||
{
|
||||
Server *s = Server::Find(uid.substr(0, 3));
|
||||
Uplink::Send("ENCAP", s ? s->GetName() : uid.substr(0, 3), "SVSLOGIN", uid, '*', '*', na->GetVHostHost().empty() ? "*" : na->GetVHostHost(), na->nc->display);
|
||||
Anope::string target = s ? s->GetName() : uid.substr(0, 3);
|
||||
if (na)
|
||||
{
|
||||
Uplink::Send("ENCAP", target, "SVSLOGIN", uid, '*', '*', na->GetVHostHost().empty() ? "*" : na->GetVHostHost(), na->nc->display);
|
||||
}
|
||||
else
|
||||
{
|
||||
Uplink::Send("ENCAP", target, "SU", uid, "");
|
||||
}
|
||||
}
|
||||
|
||||
void SendSVSNOOP(const Server *server, bool set) override
|
||||
|
||||
@@ -45,7 +45,6 @@ public:
|
||||
CanSZLine = true;
|
||||
CanSVSNick = true;
|
||||
CanSVSHold = true;
|
||||
CanSVSLogout = true;
|
||||
CanSetVHost = true;
|
||||
RequiresID = true;
|
||||
MaxModes = 4;
|
||||
@@ -355,8 +354,6 @@ class ProtoSolanum final
|
||||
IRCDMessagePrivmsg message_privmsg;
|
||||
IRCDMessageServer message_server;
|
||||
|
||||
bool use_server_side_mlock;
|
||||
|
||||
static void AddModes()
|
||||
{
|
||||
/* Add user modes */
|
||||
@@ -445,18 +442,13 @@ public:
|
||||
OnUserLogin(u);
|
||||
}
|
||||
|
||||
void OnReload(Configuration::Conf *conf) override
|
||||
{
|
||||
use_server_side_mlock = conf->GetModule(this)->Get<bool>("use_server_side_mlock");
|
||||
}
|
||||
|
||||
void OnChannelSync(Channel *c) override
|
||||
{
|
||||
if (!c->ci)
|
||||
return;
|
||||
|
||||
ModeLocks *modelocks = c->ci->GetExt<ModeLocks>("modelocks");
|
||||
if (use_server_side_mlock && modelocks && Servers::Capab.count("MLOCK") > 0)
|
||||
if (modelocks && Servers::Capab.count("MLOCK") > 0)
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "");
|
||||
Uplink::Send("MLOCK", c->creation_time, c->ci->name, modes);
|
||||
@@ -467,7 +459,7 @@ public:
|
||||
{
|
||||
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
|
||||
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
|
||||
if (use_server_side_mlock && cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
|
||||
if (cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "") + cm->mchar;
|
||||
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, modes);
|
||||
@@ -480,7 +472,7 @@ public:
|
||||
{
|
||||
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
|
||||
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
|
||||
if (use_server_side_mlock && cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
|
||||
if (cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "").replace_all_cs(cm->mchar, "");
|
||||
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, modes);
|
||||
|
||||
@@ -37,8 +37,8 @@ public:
|
||||
CanSZLine = true;
|
||||
CanSVSHold = true;
|
||||
CanClearBans = true;
|
||||
CanSVSLogout = true;
|
||||
CanCertFP = true;
|
||||
CanTagMessage = true;
|
||||
RequiresID = true;
|
||||
MaxModes = 12;
|
||||
}
|
||||
@@ -676,24 +676,18 @@ public:
|
||||
/* Borrowed part of this check from UnrealIRCd */
|
||||
bool IsValid(Anope::string &value) const override
|
||||
{
|
||||
if (value.empty() || value[0] == ':')
|
||||
if (value.empty() || value[0] != '[')
|
||||
return false;
|
||||
|
||||
Anope::string rest;
|
||||
auto num1 = Anope::Convert<unsigned>(value[0] == '*' ? value.substr(1) : value, 0, &rest);
|
||||
if (!num1 || rest[0] != ':' || rest.length() <= 1)
|
||||
return false;
|
||||
|
||||
if (Anope::Convert<int>(rest.substr(1), 0, &rest) > 0 && rest.empty())
|
||||
return true;
|
||||
|
||||
/* '['<number><1 letter>[optional: '#'+1 letter],[next..]']'':'<number> */
|
||||
size_t end_bracket = value.find(']', 1);
|
||||
if (end_bracket == Anope::string::npos)
|
||||
return false;
|
||||
|
||||
Anope::string xbuf = value.substr(0, end_bracket);
|
||||
if (value[end_bracket + 1] != ':')
|
||||
return false;
|
||||
|
||||
commasepstream args(xbuf.substr(1));
|
||||
Anope::string arg;
|
||||
while (args.GetToken(arg))
|
||||
@@ -736,8 +730,7 @@ public:
|
||||
// The part after the ':' is a duration and it
|
||||
// can be in the user friendly "1d3h20m" format, make sure we accept that
|
||||
auto n = Anope::DoTime(rest.substr(1));
|
||||
return n <= 0;
|
||||
return false;
|
||||
return n > 0;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1696,8 +1689,6 @@ class ProtoUnreal final
|
||||
IRCDMessageUID message_uid;
|
||||
IRCDMessageUmode2 message_umode2;
|
||||
|
||||
bool use_server_side_mlock;
|
||||
|
||||
public:
|
||||
ProtoUnreal(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL | VENDOR),
|
||||
ircd_proto(this),
|
||||
@@ -1720,11 +1711,6 @@ public:
|
||||
ModuleManager::SetPriority(this, PRIORITY_FIRST);
|
||||
}
|
||||
|
||||
void OnReload(Configuration::Conf *conf) override
|
||||
{
|
||||
use_server_side_mlock = conf->GetModule(this)->Get<bool>("use_server_side_mlock");
|
||||
}
|
||||
|
||||
void OnUserNickChange(User *u, const Anope::string &) override
|
||||
{
|
||||
u->RemoveModeInternal(Me, ModeManager::FindUserModeByName("REGISTERED"));
|
||||
@@ -1738,7 +1724,7 @@ public:
|
||||
return;
|
||||
|
||||
ModeLocks *modelocks = c->ci->GetExt<ModeLocks>("modelocks");
|
||||
if (use_server_side_mlock && Servers::Capab.count("MLOCK") > 0 && modelocks)
|
||||
if (Servers::Capab.count("MLOCK") > 0 && modelocks)
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "");
|
||||
Uplink::Send("MLOCK", c->creation_time, c->ci->name, modes);
|
||||
@@ -1748,7 +1734,7 @@ public:
|
||||
void OnChanRegistered(ChannelInfo *ci) override
|
||||
{
|
||||
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
|
||||
if (!ci->c || !use_server_side_mlock || !modelocks || !Servers::Capab.count("MLOCK"))
|
||||
if (!ci->c || !modelocks || !Servers::Capab.count("MLOCK"))
|
||||
return;
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "");
|
||||
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, modes);
|
||||
@@ -1756,7 +1742,7 @@ public:
|
||||
|
||||
void OnDelChan(ChannelInfo *ci) override
|
||||
{
|
||||
if (!ci->c || !use_server_side_mlock || !Servers::Capab.count("MLOCK"))
|
||||
if (!ci->c || !Servers::Capab.count("MLOCK"))
|
||||
return;
|
||||
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, "");
|
||||
}
|
||||
@@ -1765,7 +1751,7 @@ public:
|
||||
{
|
||||
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
|
||||
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
|
||||
if (use_server_side_mlock && cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
|
||||
if (cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "") + cm->mchar;
|
||||
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, modes);
|
||||
@@ -1778,7 +1764,7 @@ public:
|
||||
{
|
||||
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
|
||||
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
|
||||
if (use_server_side_mlock && cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
|
||||
if (cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "").replace_all_cs(cm->mchar, "");
|
||||
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, modes);
|
||||
|
||||
+1
-1
@@ -237,7 +237,7 @@ public:
|
||||
void StartTransaction() override
|
||||
{
|
||||
if (in_transaction)
|
||||
throw CoreException();
|
||||
throw ModuleException("Tried to start a transaction while one was already in progress");
|
||||
|
||||
this->SendCommand(NULL, "MULTI");
|
||||
in_transaction = true;
|
||||
|
||||
+1
-9
@@ -145,14 +145,6 @@ public:
|
||||
|
||||
void ProcessMessage(Session *sess, const SASL::Message &m) override
|
||||
{
|
||||
if (!IRCD->CanSVSLogout && !User::Find(sess->uid))
|
||||
{
|
||||
// This IRCd can't log users out yet.
|
||||
sasl->Fail(sess);
|
||||
delete sess;
|
||||
return;
|
||||
}
|
||||
|
||||
if (m.type == "S")
|
||||
{
|
||||
sasl->SendMessage(sess, "C", "+");
|
||||
@@ -310,7 +302,7 @@ public:
|
||||
// If the user is already introduced then we log them in now.
|
||||
// Otherwise, we send an SVSLOGIN to log them in later.
|
||||
User *user = User::Find(session->uid);
|
||||
NickAlias *na = NickAlias::Find(nc->display);
|
||||
NickAlias *na = nc ? nc->na : nullptr;
|
||||
if (user)
|
||||
{
|
||||
if (na)
|
||||
|
||||
@@ -103,7 +103,7 @@ bool WebCPanel::NickServ::Info::OnRequest(HTTPProvider *server, const Anope::str
|
||||
replacements["DISPLAY"] = na->nc->display;
|
||||
if (!na->nc->email.empty())
|
||||
replacements["EMAIL"] = na->nc->email;
|
||||
replacements["TIME_REGISTERED"] = Anope::strftime(na->time_registered, na->nc);
|
||||
replacements["TIME_REGISTERED"] = Anope::strftime(na->nc->time_registered, na->nc);
|
||||
if (na->HasVHost())
|
||||
replacements["VHOST"] = na->GetVHostMask();
|
||||
Anope::string *greet = na->nc->GetExt<Anope::string>("greet");
|
||||
|
||||
@@ -26,6 +26,7 @@ CommandSource::CommandSource(const Anope::string &n, User *user, NickCore *core,
|
||||
: nick(n)
|
||||
, u(user)
|
||||
, nc(core)
|
||||
, ip(user ? user->ip.str() : "")
|
||||
, reply(r)
|
||||
, service(bi)
|
||||
, msgid(m)
|
||||
|
||||
+5
-5
@@ -325,8 +325,8 @@ bool Anope::Init(int ac, char **av)
|
||||
Log(LOG_TERMINAL) << "-d, --debug[=level]";
|
||||
Log(LOG_TERMINAL) << "-h, --help";
|
||||
Log(LOG_TERMINAL) << " --localedir=locale directory";
|
||||
Log(LOG_TERMINAL) << " --logdir=logs directory";
|
||||
Log(LOG_TERMINAL) << " --modulesdir=modules directory";
|
||||
Log(LOG_TERMINAL) << " --logdir=log directory";
|
||||
Log(LOG_TERMINAL) << " --moduledir=module directory";
|
||||
Log(LOG_TERMINAL) << "-e, --noexpire";
|
||||
Log(LOG_TERMINAL) << "-n, --nofork";
|
||||
Log(LOG_TERMINAL) << "-p, --nopid";
|
||||
@@ -409,10 +409,10 @@ bool Anope::Init(int ac, char **av)
|
||||
Anope::LocaleDir = arg;
|
||||
}
|
||||
|
||||
if (GetCommandLineArgument("modulesdir", 0, arg))
|
||||
if (GetCommandLineArgument("moduledir", 0, arg))
|
||||
{
|
||||
if (arg.empty())
|
||||
throw CoreException("The --modulesdir option requires a path");
|
||||
throw CoreException("The --moduledir option requires a path");
|
||||
Anope::ModuleDir = arg;
|
||||
}
|
||||
|
||||
@@ -536,7 +536,7 @@ bool Anope::Init(int ac, char **av)
|
||||
|
||||
auto *encryption = ModuleManager::FindFirstOf(ENCRYPTION);
|
||||
if (!encryption)
|
||||
throw CoreException("You must load an encryption module!");
|
||||
throw CoreException("You must load a non-deprecated encryption module!");
|
||||
|
||||
auto *protocol = ModuleManager::FindFirstOf(PROTOCOL);
|
||||
if (!protocol)
|
||||
|
||||
+1
-1
@@ -364,7 +364,7 @@ void LogInfo::ProcessMessage(const Log *l)
|
||||
if (!bi)
|
||||
bi = c->WhoSends();
|
||||
if (bi)
|
||||
IRCD->SendPrivmsg(bi, c->name, "%s", buffer.c_str());
|
||||
IRCD->SendPrivmsg(bi, c->name, buffer);
|
||||
}
|
||||
}
|
||||
else if (target == "globops")
|
||||
|
||||
+1
-1
@@ -167,7 +167,7 @@ int main(int ac, char **av, char **envp)
|
||||
|
||||
/* Set up timers */
|
||||
time_t last_check = Anope::CurTime;
|
||||
UpdateTimer updateTimer(Config->GetBlock("options")->Get<time_t>("updatetimeout", "5m"));
|
||||
UpdateTimer updateTimer(Config->GetBlock("options")->Get<time_t>("updatetimeout", "2m"));
|
||||
ExpireTimer expireTimer(Config->GetBlock("options")->Get<time_t>("expiretimeout", "30m"));
|
||||
|
||||
/*** Main loop. ***/
|
||||
|
||||
+6
-8
@@ -342,19 +342,17 @@ void Privmsg::Run(MessageSource &source, const std::vector<Anope::string> ¶m
|
||||
|
||||
if (bi)
|
||||
{
|
||||
if (message[0] == '\1' && message[message.length() - 1] == '\1')
|
||||
Anope::string ctcpname, ctcpbody;
|
||||
if (Anope::ParseCTCP(message, ctcpname, ctcpbody))
|
||||
{
|
||||
if (message.substr(0, 6).equals_ci("\1PING "))
|
||||
if (ctcpname.equals_ci("PING"))
|
||||
{
|
||||
Anope::string buf = message;
|
||||
buf.erase(buf.begin());
|
||||
buf.erase(buf.end() - 1);
|
||||
IRCD->SendCTCP(bi, u->nick, "%s", buf.c_str());
|
||||
IRCD->SendNotice(bi, u->nick, Anope::FormatCTCP("PING", ctcpbody));
|
||||
}
|
||||
else if (message.substr(0, 9).equals_ci("\1VERSION\1"))
|
||||
else if (ctcpname.equals_ci("VERSION"))
|
||||
{
|
||||
Module *enc = ModuleManager::FindFirstOf(ENCRYPTION);
|
||||
IRCD->SendCTCP(bi, u->nick, "VERSION Anope-%s %s :%s - (%s) -- %s", Anope::Version().c_str(), Me->GetName().c_str(), IRCD->GetProtocolName().c_str(), enc ? enc->name.c_str() : "(none)", Anope::VersionBuildString().c_str());
|
||||
IRCD->SendNotice(bi, u->nick, Anope::FormatCTCP("VERSION", Anope::printf("Anope-%s %s :%s - (%s) -- %s", Anope::Version().c_str(), Me->GetName().c_str(), IRCD->GetProtocolName().c_str(), enc ? enc->name.c_str() : "(none)", Anope::VersionBuildString().c_str())));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -835,3 +835,50 @@ Anope::string Anope::Expand(const Anope::string &base, const Anope::string &frag
|
||||
|
||||
return Anope::printf("%s%c%s", base.c_str(), separator, fragment.c_str());
|
||||
}
|
||||
|
||||
Anope::string Anope::FormatCTCP(const Anope::string &name, const Anope::string &value)
|
||||
{
|
||||
if (value.empty())
|
||||
return Anope::printf("\1%s\1", name.c_str());
|
||||
|
||||
return Anope::printf("\1%s %s\1", name.c_str(), value.c_str());
|
||||
}
|
||||
|
||||
bool Anope::ParseCTCP(const Anope::string &text, Anope::string &name, Anope::string &body)
|
||||
{
|
||||
// According to draft-oakley-irc-ctcp-02 a valid CTCP must begin with SOH and
|
||||
// contain at least one octet which is not NUL, SOH, CR, LF, or SPACE. As most
|
||||
// of these are restricted at the protocol level we only need to check for SOH
|
||||
// and SPACE.
|
||||
if (text.length() < 2 || text[0] != '\x1' || text[1] == '\x1' || text[1] == ' ')
|
||||
{
|
||||
name.clear();
|
||||
body.clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
auto end_of_name = text.find(' ', 2);
|
||||
auto end_of_ctcp = *text.rbegin() == '\x1' ? 1 : 0;
|
||||
if (end_of_name == std::string::npos)
|
||||
{
|
||||
// The CTCP only contains a name.
|
||||
name = text.substr(1, text.length() - 1 - end_of_ctcp);
|
||||
body.clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
// The CTCP contains a name and a body.
|
||||
name = text.substr(1, end_of_name - 1);
|
||||
|
||||
auto start_of_body = text.find_first_not_of(' ', end_of_name + 1);
|
||||
if (start_of_body == std::string::npos)
|
||||
{
|
||||
// The CTCP body is provided but empty.
|
||||
body.clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
// The CTCP body provided was non-empty.
|
||||
body = text.substr(start_of_body, text.length() - start_of_body - end_of_ctcp);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ NickAlias::NickAlias(const Anope::string &nickname, NickCore *nickcore)
|
||||
throw CoreException("Empty nickcore passed to NickAlias constructor");
|
||||
|
||||
nickcore->aliases->push_back(this);
|
||||
if (this->nick.equals_ci(nickcore->display))
|
||||
nickcore->na = this;
|
||||
|
||||
if (!NickAliasList->insert_or_assign(this->nick, this).second)
|
||||
Log(LOG_DEBUG) << "Duplicate nick " << this->nick << " in NickAlias table";
|
||||
@@ -216,6 +218,9 @@ Serializable *NickAlias::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
data["extensible:NO_EXPIRE"] >> b;
|
||||
if (b)
|
||||
na->Extend<bool>("NS_NO_EXPIRE");
|
||||
|
||||
if (na->time_registered < na->nc->time_registered)
|
||||
na->nc->time_registered = na->time_registered;
|
||||
/* end compat */
|
||||
|
||||
return na;
|
||||
|
||||
+7
-10
@@ -73,7 +73,9 @@ void NickCore::Serialize(Serialize::Data &data) const
|
||||
data["pass"] << this->pass;
|
||||
data["email"] << this->email;
|
||||
data["language"] << this->language;
|
||||
data["lastmail"] << this->lastmail;
|
||||
data.SetType("lastmail", Serialize::Data::DT_INT); data["lastmail"] << this->lastmail;
|
||||
data.SetType("time_registered", Serialize::Data::DT_INT); data["time_registered"] << this->time_registered;
|
||||
|
||||
data["memomax"] << this->memos.memomax;
|
||||
for (const auto &ignore : this->memos.ignores)
|
||||
data["memoignores"] << ignore << " ";
|
||||
@@ -99,6 +101,7 @@ Serializable *NickCore::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
data["email"] >> nc->email;
|
||||
data["language"] >> nc->language;
|
||||
data["lastmail"] >> nc->lastmail;
|
||||
data["time_registered"] >> nc->time_registered;
|
||||
data["memomax"] >> nc->memos.memomax;
|
||||
{
|
||||
Anope::string buf;
|
||||
@@ -146,7 +149,7 @@ Serializable *NickCore::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
return nc;
|
||||
}
|
||||
|
||||
void NickCore::SetDisplay(const NickAlias *na)
|
||||
void NickCore::SetDisplay(NickAlias *na)
|
||||
{
|
||||
if (na->nc != this || na->nick == this->display)
|
||||
return;
|
||||
@@ -161,6 +164,7 @@ void NickCore::SetDisplay(const NickAlias *na)
|
||||
NickCoreList->erase(this->display);
|
||||
|
||||
this->display = na->nick;
|
||||
this->na = na;
|
||||
|
||||
(*NickCoreList)[this->display] = this;
|
||||
}
|
||||
@@ -206,14 +210,7 @@ uint64_t NickCore::GetId()
|
||||
if (this->id)
|
||||
return this->id;
|
||||
|
||||
NickAlias *na = NickAlias::Find(this->display);
|
||||
if (!na)
|
||||
{
|
||||
Log(LOG_DEBUG) << "Unable to find the display NickAlias for NickCore: " << this->display;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Anope::string secretid = this->display + "\0" + Anope::ToString(na->time_registered);
|
||||
Anope::string secretid = this->display + "\0" + Anope::ToString(this->time_registered);
|
||||
|
||||
// Generate the account id. This should almost always only have one
|
||||
// iteration but in the rare case that we generate a duplicate id we try
|
||||
|
||||
+10
-51
@@ -135,16 +135,22 @@ void IRCDProto::SendKick(const MessageSource &source, const Channel *c, User *u,
|
||||
Uplink::Send(source, "KICK", c->name, u->GetUID());
|
||||
}
|
||||
|
||||
void IRCDProto::SendNoticeInternal(const MessageSource &source, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags)
|
||||
void IRCDProto::SendNotice(const MessageSource &source, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags)
|
||||
{
|
||||
Uplink::Send(tags, source, "NOTICE", dest, msg.empty() ? " " : msg);
|
||||
}
|
||||
|
||||
void IRCDProto::SendPrivmsgInternal(const MessageSource &source, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags)
|
||||
void IRCDProto::SendPrivmsg(const MessageSource &source, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags)
|
||||
{
|
||||
Uplink::Send(tags, source, "PRIVMSG", dest, msg.empty() ? " " : msg);
|
||||
}
|
||||
|
||||
void IRCDProto::SendTagmsg(const MessageSource &source, const Anope::string &dest, const Anope::map<Anope::string> &tags)
|
||||
{
|
||||
if (CanTagMessage)
|
||||
Uplink::Send(tags, source, "TAGMSG", dest);
|
||||
}
|
||||
|
||||
void IRCDProto::SendQuit(User *u, const Anope::string &buf)
|
||||
{
|
||||
if (!buf.empty())
|
||||
@@ -166,12 +172,6 @@ void IRCDProto::SendGlobops(const MessageSource &source, const Anope::string &me
|
||||
Uplink::Send(source, "GLOBOPS", message);
|
||||
}
|
||||
|
||||
void IRCDProto::SendCTCPInternal(const MessageSource &source, const Anope::string &dest, const Anope::string &buf)
|
||||
{
|
||||
Anope::string s = Anope::NormalizeBuffer(buf);
|
||||
this->SendNoticeInternal(source, dest, "\1" + s + "\1");
|
||||
}
|
||||
|
||||
void IRCDProto::SendNumericInternal(int numeric, const Anope::string &dest, const std::vector<Anope::string> ¶ms)
|
||||
{
|
||||
Anope::string n = Anope::ToString(numeric);
|
||||
@@ -190,37 +190,6 @@ void IRCDProto::SendTopic(const MessageSource &source, Channel *c)
|
||||
Uplink::Send(source, "TOPIC", c->name, c->topic);
|
||||
}
|
||||
|
||||
void IRCDProto::SendNotice(const MessageSource &source, const Anope::string &dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE] = "";
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
SendNoticeInternal(source, dest, buf);
|
||||
}
|
||||
|
||||
void IRCDProto::SendAction(const MessageSource &source, const Anope::string &dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE] = "";
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
Anope::string actionbuf = Anope::string("\1ACTION ") + buf + '\1';
|
||||
SendPrivmsgInternal(source, dest, actionbuf);
|
||||
}
|
||||
|
||||
void IRCDProto::SendPrivmsg(const MessageSource &source, const Anope::string &dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE] = "";
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
SendPrivmsgInternal(source, dest, buf);
|
||||
}
|
||||
|
||||
void IRCDProto::SendPing(const Anope::string &servname, const Anope::string &who)
|
||||
{
|
||||
if (servname.empty())
|
||||
@@ -263,16 +232,6 @@ void IRCDProto::SendForceNickChange(User *u, const Anope::string &newnick, time_
|
||||
Uplink::Send("SVSNICK", u->GetUID(), newnick, when);
|
||||
}
|
||||
|
||||
void IRCDProto::SendCTCP(const MessageSource &source, const Anope::string &dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE] = "";
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
SendCTCPInternal(source, dest, buf);
|
||||
}
|
||||
|
||||
bool IRCDProto::IsNickValid(const Anope::string &nick)
|
||||
{
|
||||
/**
|
||||
@@ -370,14 +329,14 @@ Anope::string IRCDProto::NormalizeMask(const Anope::string &mask)
|
||||
|
||||
void IRCDProto::SendContextNotice(BotInfo *bi, User *target, Channel *context, const Anope::string &msg)
|
||||
{
|
||||
IRCD->SendNoticeInternal(bi, target->GetUID(), Anope::printf("[%s] %s", context->name.c_str(), msg.c_str()), {
|
||||
IRCD->SendNotice(bi, target->GetUID(), Anope::printf("[%s] %s", context->name.c_str(), msg.c_str()), {
|
||||
{ "+draft/channel-context", context->name },
|
||||
});
|
||||
}
|
||||
|
||||
void IRCDProto::SendContextPrivmsg(BotInfo *bi, User *target, Channel *context, const Anope::string &msg)
|
||||
{
|
||||
IRCD->SendPrivmsgInternal(bi, target->GetUID(), Anope::printf("[%s] %s", context->name.c_str(), msg.c_str()), {
|
||||
IRCD->SendPrivmsg(bi, target->GetUID(), Anope::printf("[%s] %s", context->name.c_str(), msg.c_str()), {
|
||||
{ "+draft/channel-context", context->name },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -239,6 +239,10 @@ Serializable *ChannelInfo::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
spacesepstream(slevels).GetTokens(v);
|
||||
for (unsigned i = 0; i + 1 < v.size(); i += 2)
|
||||
{
|
||||
// Begin 2.0 database compatibility.
|
||||
if (v[i] == "FANTASIA")
|
||||
v[i] = "FANTASY";
|
||||
// End 2.0 database compatibility.
|
||||
if (auto level = Anope::TryConvert<int16_t>(v[i + 1]))
|
||||
ci->levels[v[i]] = level.value();
|
||||
}
|
||||
|
||||
+9
-4
@@ -337,9 +337,9 @@ namespace
|
||||
for (Anope::string tok; sep.GetToken(tok);)
|
||||
{
|
||||
if (target->ShouldPrivmsg())
|
||||
IRCD->SendPrivmsgInternal(source, target->GetUID(), tok, tags);
|
||||
IRCD->SendPrivmsg(source, target->GetUID(), tok, tags);
|
||||
else
|
||||
IRCD->SendNoticeInternal(source, target->GetUID(), tok, tags);
|
||||
IRCD->SendNotice(source, target->GetUID(), tok, tags);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -430,6 +430,11 @@ NickCore *User::Account() const
|
||||
return this->nc;
|
||||
}
|
||||
|
||||
NickAlias *User::AccountNick() const
|
||||
{
|
||||
return this->nc ? this->nc->na : nullptr;
|
||||
}
|
||||
|
||||
bool User::IsIdentified(bool check_nick) const
|
||||
{
|
||||
if (check_nick && this->nc)
|
||||
@@ -825,14 +830,14 @@ Anope::string User::Mask() const
|
||||
|
||||
bool User::BadPassword()
|
||||
{
|
||||
if (!Config->GetBlock("options")->Get<int>("badpasslimit"))
|
||||
if (!Config->GetBlock("options")->Get<unsigned int>("badpasslimit"))
|
||||
return false;
|
||||
|
||||
if (Config->GetBlock("options")->Get<time_t>("badpasstimeout") > 0 && this->invalid_pw_time > 0 && this->invalid_pw_time < Anope::CurTime - Config->GetBlock("options")->Get<time_t>("badpasstimeout"))
|
||||
this->invalid_pw_count = 0;
|
||||
++this->invalid_pw_count;
|
||||
this->invalid_pw_time = Anope::CurTime;
|
||||
if (this->invalid_pw_count >= Config->GetBlock("options")->Get<int>("badpasslimit"))
|
||||
if (this->invalid_pw_count >= Config->GetBlock("options")->Get<unsigned int>("badpasslimit"))
|
||||
{
|
||||
this->Kill(Me, "Too many invalid passwords");
|
||||
return true;
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@
|
||||
|
||||
VERSION_MAJOR=2
|
||||
VERSION_MINOR=1
|
||||
VERSION_PATCH=5
|
||||
VERSION_PATCH=7
|
||||
VERSION_EXTRA=""
|
||||
|
||||
@@ -23,18 +23,15 @@ static struct WindowsLanguage final
|
||||
Anope::string languageName;
|
||||
USHORT windowsLanguageName;
|
||||
} WindowsLanguages[] = {
|
||||
{"ca_ES", LANG_CATALAN},
|
||||
{"de_DE", LANG_GERMAN},
|
||||
{"el_GR", LANG_GREEK},
|
||||
{"en_US", LANG_ENGLISH},
|
||||
{"es_ES", LANG_SPANISH},
|
||||
{"fr_FR", LANG_FRENCH},
|
||||
{"hu_HU", LANG_HUNGARIAN},
|
||||
{"it_IT", LANG_ITALIAN},
|
||||
{"nl_NL", LANG_DUTCH},
|
||||
{"pl_PL", LANG_POLISH},
|
||||
{"pt_PT", LANG_PORTUGUESE},
|
||||
{"ru_RU", LANG_RUSSIAN},
|
||||
{"tr_TR", LANG_TURKISH},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user