typedef std::deque<std::string> file_cache;
typedef file_cache string_list;
+
// This #define allows us to call a method in all
// loaded modules in a readable simple way, e.g.:
// 'FOREACH_MOD OnConnect(user);'
* This method is the lowest level of handler available to a module. It will be called with raw
* data which is passing through a connected socket. If you wish, you may munge this data by changing
* the string parameter "raw". If you do this, after your function exits it will immediately be
- * cut down to 510 characters plus a carriage return and linefeed.
+ * cut down to 510 characters plus a carriage return and linefeed. For INBOUND messages only (where
+ * inbound is set to true) the value of user will be the userrec of the connection sending the
+ * data. This is not possible for outbound data because the data may be being routed to multiple targets.
*/
- virtual void OnServerRaw(std::string &raw, bool inbound);
+ virtual void OnServerRaw(std::string &raw, bool inbound, userrec* user);
/** Called whenever an extended mode is to be processed.
* The type parameter is MT_SERVER, MT_CLIENT or MT_CHANNEL, dependent on where the mode is being
* of where the message is destined to be sent.
*/
virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string text);
+
+ /** Called before any nickchange, local or remote. This can be used to implement Q-lines etc.
+ * Please note that although you can see remote nickchanges through this function, you should
+ * NOT make any changes to the userrec if the user is a remote user as this may cause a desnyc.
+ * check user->server before taking any action (including returning nonzero from the method).
+ * If your method returns nonzero, the nickchange is silently forbidden, and it is down to your
+ * module to generate some meaninful output.
+ */
+ virtual int OnUserPreNick(userrec* user, std::string newnick);
};
* linked servers.
*/
virtual void ChangeGECOS(userrec* user, std::string gecos);
+
+ /** Returns true if the servername you give is ulined.
+ * ULined servers have extra privilages. They are allowed to change nicknames on remote servers,
+ * change modes of clients which are on remote servers and set modes of channels where there are
+ * no channel operators for that channel on the ulined server, amongst other things. Ulined server
+ * data is also broadcast across the mesh at all times as opposed to selectively messaged in the
+ * case of normal servers, as many ulined server types (such as services) do not support meshed
+ * links and must operate in this manner.
+ */
+ virtual bool IsUlined(std::string server);
};
/** Allows reading of values from configuration files