aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGravatar Sadie Powell2019-01-24 15:58:57 +0000
committerGravatar Sadie Powell2019-01-24 15:58:57 +0000
commit1799bcff97e8018156df809fd3cae3ed3d663591 (patch)
treee8ed9f51b8d52f188c9b3d18abab4ebde915c3d4 /include
parentAdd translation for casemapping between 2.0/3.0 (#1544) (diff)
parentAdd translation for casemapping between 2.0/3.0 (#1544) (diff)
Merge branch 'insp3' into master
Diffstat (limited to 'include')
-rw-r--r--include/bancache.h2
-rw-r--r--include/clientprotocol.h2
-rw-r--r--include/configreader.h19
-rw-r--r--include/ctables.h21
-rw-r--r--include/hashcomp.h5
-rw-r--r--include/inspircd.h2
-rw-r--r--include/inspsocket.h3
-rw-r--r--include/modules.h3
-rw-r--r--include/users.h21
-rw-r--r--include/xline.h24
10 files changed, 37 insertions, 65 deletions
diff --git a/include/bancache.h b/include/bancache.h
index 6e19e1ebe..e0c84ab54 100644
--- a/include/bancache.h
+++ b/include/bancache.h
@@ -62,7 +62,7 @@ class CoreExport BanCacheManager
* @param ip The IP the item is for.
* @param type The type of ban cache item. std::string. .empty() means it's a negative match (user is allowed freely).
* @param reason The reason for the ban. Left .empty() if it's a negative match.
- * @param seconds Number of seconds before nuking the bancache entry, the default is a day. This might seem long, but entries will be removed as glines/etc expire.
+ * @param seconds Number of seconds before nuking the bancache entry, the default is a day. This might seem long, but entries will be removed as G-lines/etc expire.
*/
BanCacheHit *AddHit(const std::string &ip, const std::string &type, const std::string &reason, time_t seconds = 0);
BanCacheHit *GetHit(const std::string &ip);
diff --git a/include/clientprotocol.h b/include/clientprotocol.h
index 10b70e80b..ec033e166 100644
--- a/include/clientprotocol.h
+++ b/include/clientprotocol.h
@@ -549,7 +549,7 @@ class ClientProtocol::MessageTagProvider : public Events::ModuleEventListener
* MOD_RES_PASSTHRU to make no decision. If no hooks accept a tag, the tag is rejected.
* The default implementation returns MOD_RES_PASSTHRU.
*/
- virtual ModResult OnClientProtocolProcessTag(User* user, const std::string& tagname, std::string& tagvalue)
+ virtual ModResult OnProcessTag(User* user, const std::string& tagname, std::string& tagvalue)
{
return MOD_RES_PASSTHRU;
}
diff --git a/include/configreader.h b/include/configreader.h
index 4360b8661..511bedbee 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -332,18 +332,6 @@ class CoreExport ServerConfig
*/
std::string ServerDesc;
- /** Pretend disabled commands don't exist.
- */
- bool DisabledDontExist;
-
- /** This variable identifies which usermodes have been diabled.
- */
- std::bitset<64> DisabledUModes;
-
- /** This variable identifies which chanmodes have been disabled.
- */
- std::bitset<64> DisabledCModes;
-
/** How to treat a user in a channel who is banned. */
BannedUserTreatment RestrictBannedUsers;
@@ -379,8 +367,8 @@ class CoreExport ServerConfig
/** The number of seconds that the server clock can skip by before server operators are warned. */
time_t TimeSkipWarn;
- /** True if we're going to hide ban reasons for non-opers (e.g. G-Lines,
- * K-Lines, Z-Lines)
+ /** True if we're going to hide ban reasons for non-opers (e.g. G-lines,
+ * K-lines, Z-lines)
*/
bool HideBans;
@@ -466,9 +454,6 @@ class CoreExport ServerConfig
void Fill();
- /** Disables the commands specified in <disabled:commands>. */
- bool ApplyDisabledCommands();
-
/** Escapes a value for storage in a configuration key.
* @param str The string to escape.
* @param xml Are we using the XML config format?
diff --git a/include/ctables.h b/include/ctables.h
index 8be40cc54..1c7d5b4bd 100644
--- a/include/ctables.h
+++ b/include/ctables.h
@@ -163,10 +163,6 @@ class CoreExport CommandBase : public ServiceProvider
*/
unsigned long use_count;
- /** True if the command is disabled to non-opers
- */
- bool disabled;
-
/** True if the command can be issued before registering
*/
bool works_before_reg;
@@ -212,23 +208,6 @@ class CoreExport CommandBase : public ServiceProvider
*/
virtual void EncodeParameter(std::string& parameter, unsigned int index);
- /** Disable or enable this command.
- * @param setting True to disable the command.
- */
- void Disable(bool setting)
- {
- disabled = setting;
- }
-
- /** Obtain this command's disable state.
- * @return true if the command is currently disabled
- * (disabled commands can be used only by operators)
- */
- bool IsDisabled()
- {
- return disabled;
- }
-
/** @return true if the command works before registration.
*/
bool WorksBeforeReg()
diff --git a/include/hashcomp.h b/include/hashcomp.h
index f0e092729..80c02332d 100644
--- a/include/hashcomp.h
+++ b/include/hashcomp.h
@@ -197,7 +197,10 @@ namespace irc
public:
/** Create a tokenstream and fill it with the provided data. */
- tokenstream(const std::string& msg, size_t start = 0);
+ tokenstream(const std::string& msg, size_t start = 0, size_t end = std::string::npos);
+
+ /** Retrieves the underlying message. */
+ std::string& GetMessage() { return message; }
/** Retrieve the next \<middle> token in the token stream.
* @param token The next token available, or an empty string if none remain.
diff --git a/include/inspircd.h b/include/inspircd.h
index 8ca2314eb..f5c7dbafb 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -284,7 +284,7 @@ class CoreExport InspIRCd
*/
TimerManager Timers;
- /** X-Line manager. Handles G/K/Q/E line setting, removal and matching
+ /** X-line manager. Handles G/K/Q/E-line setting, removal and matching
*/
XLineManager* XLines;
diff --git a/include/inspsocket.h b/include/inspsocket.h
index e432f9c16..69fdaac8b 100644
--- a/include/inspsocket.h
+++ b/include/inspsocket.h
@@ -312,8 +312,9 @@ class CoreExport StreamSocket : public EventHandler
/** Called when the endpoint addresses are changed.
* @param local The new local endpoint.
* @param remote The new remote endpoint.
+ * @return true if the connection is still open, false if it has been closed
*/
- virtual void OnSetEndPoint(const irc::sockets::sockaddrs& local, const irc::sockets::sockaddrs& remote) { }
+ virtual bool OnSetEndPoint(const irc::sockets::sockaddrs& local, const irc::sockets::sockaddrs& remote);
/** Send the given data out the socket, either now or when writes unblock
*/
diff --git a/include/modules.h b/include/modules.h
index b4f13c6b7..b8c860fbc 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -99,7 +99,8 @@ struct ModResult {
/** InspIRCd major version.
* 1.2 -> 102; 2.1 -> 201; 2.12 -> 212
*/
-#define INSPIRCD_VERSION_MAJ 202
+#define INSPIRCD_VERSION_MAJ 300
+
/** InspIRCd API version.
* If you change any API elements, increment this value. This counter should be
* reset whenever the major version is changed. Modules can use these two values
diff --git a/include/users.h b/include/users.h
index ef19adb5d..3937f74aa 100644
--- a/include/users.h
+++ b/include/users.h
@@ -380,9 +380,9 @@ class CoreExport User : public Extensible
/** Sets the client IP for this user
* @return true if the conversion was successful
*/
- virtual bool SetClientIP(const std::string& address, bool recheck_eline = true);
+ virtual bool SetClientIP(const std::string& address);
- virtual void SetClientIP(const irc::sockets::sockaddrs& sa, bool recheck_eline = true);
+ virtual void SetClientIP(const irc::sockets::sockaddrs& sa);
/** Constructor
* @throw CoreException if the UID allocated to the user already exists
@@ -681,15 +681,18 @@ class CoreExport User : public Extensible
class CoreExport UserIOHandler : public StreamSocket
{
+ private:
+ size_t checked_until;
public:
LocalUser* const user;
UserIOHandler(LocalUser* me)
: StreamSocket(StreamSocket::SS_USER)
+ , checked_until(0)
, user(me)
{
}
void OnDataReady() CXX11_OVERRIDE;
- void OnSetEndPoint(const irc::sockets::sockaddrs& local, const irc::sockets::sockaddrs& remote) CXX11_OVERRIDE;
+ bool OnSetEndPoint(const irc::sockets::sockaddrs& local, const irc::sockets::sockaddrs& remote) CXX11_OVERRIDE;
void OnError(BufferedSocketError error) CXX11_OVERRIDE;
/** Adds to the user's write buffer.
@@ -784,7 +787,7 @@ class CoreExport LocalUser : public User, public insp::intrusive_list_node<Local
*/
unsigned int lastping:1;
- /** This is true if the user matched an exception (E:Line). It is used to save time on ban checks.
+ /** This is true if the user matched an exception (E-line). It is used to save time on ban checks.
*/
unsigned int exempt:1;
@@ -803,14 +806,14 @@ class CoreExport LocalUser : public User, public insp::intrusive_list_node<Local
already_sent_t already_sent;
- /** Check if the user matches a G or K line, and disconnect them if they do.
- * @param doZline True if ZLines should be checked (if IP has changed since initial connect)
+ /** Check if the user matches a G- or K-line, and disconnect them if they do.
+ * @param doZline True if Z-lines should be checked (if IP has changed since initial connect)
* Returns true if the user matched a ban, false else.
*/
bool CheckLines(bool doZline = false);
/** Use this method to fully connect a user.
- * This will send the message of the day, check G/K/E lines, etc.
+ * This will send the message of the day, check G/K/E-lines, etc.
*/
void FullConnect();
@@ -820,9 +823,9 @@ class CoreExport LocalUser : public User, public insp::intrusive_list_node<Local
*/
void SetClass(const std::string &explicit_name = "");
- bool SetClientIP(const std::string& address, bool recheck_eline = true) CXX11_OVERRIDE;
+ bool SetClientIP(const std::string& address) CXX11_OVERRIDE;
- void SetClientIP(const irc::sockets::sockaddrs& sa, bool recheck_eline = true) CXX11_OVERRIDE;
+ void SetClientIP(const irc::sockets::sockaddrs& sa) CXX11_OVERRIDE;
/** Send a NOTICE message from the local server to the user.
* The message will be sent even if the user is connected to a remote server.
diff --git a/include/xline.h b/include/xline.h
index 44f16cadf..dbb89277b 100644
--- a/include/xline.h
+++ b/include/xline.h
@@ -22,7 +22,7 @@
#pragma once
-/** XLine is the base class for ban lines such as G lines and K lines.
+/** XLine is the base class for ban lines such as G-lines and K-lines.
* Modules may derive from this, and their xlines will automatically be
* handled as expected by any protocol modules (e.g. m_spanningtree will
* propogate them using AddLine). The process of translating a type+pattern
@@ -67,7 +67,7 @@ class CoreExport XLine : public classbase
}
/** Change creation time of an xline. Updates expiry
- * to be after the creation time
+ * to be after the creation time.
*/
virtual void SetCreateTime(time_t created)
{
@@ -102,7 +102,7 @@ class CoreExport XLine : public classbase
virtual void Unset() { }
/** Called when the expiry message is to be displayed for the
- * line. Usually a line in the form 'expiring Xline blah, set by...'
+ * line. Usually a line in the form 'expiring X-line blah, set by...'
* see the DisplayExpiry methods of GLine, ELine etc.
*/
virtual void DisplayExpiry();
@@ -111,7 +111,7 @@ class CoreExport XLine : public classbase
* e.g. '*\@foo' or '*baz*'. This must always return the full pattern
* in a form which can be used to construct an entire derived xline,
* even if it is stored differently internally (e.g. GLine stores the
- * ident and host parts seperately but will still return ident\@host
+ * ident and host parts separately but will still return ident\@host
* for its Displayable() method).
*/
virtual const std::string& Displayable() = 0;
@@ -157,7 +157,7 @@ class CoreExport KLine : public XLine
{
public:
- /** Create a K-Line.
+ /** Create a K-line.
* @param s_time The set time
* @param d The duration of the xline
* @param src The sender of the xline
@@ -203,7 +203,7 @@ class CoreExport KLine : public XLine
class CoreExport GLine : public XLine
{
public:
- /** Create a G-Line.
+ /** Create a G-line.
* @param s_time The set time
* @param d The duration of the xline
* @param src The sender of the xline
@@ -247,7 +247,7 @@ class CoreExport GLine : public XLine
class CoreExport ELine : public XLine
{
public:
- /** Create an E-Line.
+ /** Create an E-line.
* @param s_time The set time
* @param d The duration of the xline
* @param src The sender of the xline
@@ -291,7 +291,7 @@ class CoreExport ELine : public XLine
class CoreExport ZLine : public XLine
{
public:
- /** Create a Z-Line.
+ /** Create a Z-line.
* @param s_time The set time
* @param d The duration of the xline
* @param src The sender of the xline
@@ -327,7 +327,7 @@ class CoreExport ZLine : public XLine
class CoreExport QLine : public XLine
{
public:
- /** Create a G-Line.
+ /** Create a Q-line.
* @param s_time The set time
* @param d The duration of the xline
* @param src The sender of the xline
@@ -399,7 +399,7 @@ class CoreExport XLineFactory
virtual ~XLineFactory() { }
};
-/** XLineManager is a class used to manage glines, klines, elines, zlines and qlines,
+/** XLineManager is a class used to manage G-lines, K-lines, E-lines, Z-lines and Q-lines,
* or any other line created by a module. It also manages XLineFactory classes which
* can generate a specialized XLine for use by another module.
*/
@@ -436,7 +436,7 @@ class CoreExport XLineManager
*/
IdentHostPair IdentSplit(const std::string &ident_and_host);
- /** Checks what users match e:lines and sets their ban exempt flag accordingly.
+ /** Checks what users match E-lines and sets their ban exempt flag accordingly.
*/
void CheckELines();
@@ -476,7 +476,7 @@ class CoreExport XLineManager
/** Registers an xline factory.
* An xline factory is a class which when given a particular xline type,
* will generate a new XLine specialized to that type. For example if you
- * pass the XLineFactory that handles glines some data it will return a
+ * pass the XLineFactory that handles G-lines some data it will return a
* pointer to a GLine, polymorphically represented as XLine. This is used where
* you do not know the full details of the item you wish to create, e.g. in a
* server protocol module like m_spanningtree, when you receive xlines from other