- * system. You should use it to reload any files so that your module keeps in step with the
- * rest of the application. If a parameter is given, the core has done nothing. The module
- * receiving the event can decide if this parameter has any relevence to it.
- * @param user The user performing the rehash, if any -- if this is server initiated, the
- * value of this variable will be NULL.
- * @param parameter The (optional) parameter given to REHASH from the user.
- */
- virtual void OnRehash(User* user, const std::string ¶meter);
-
- /** Called when a raw command is transmitted or received.
- * 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. For INBOUND messages only (where
- * inbound is set to true) the value of user will be the User of the connection sending the
- * data. This is not possible for outbound data because the data may be being routed to multiple targets.
- * @param raw The raw string in RFC1459 format
- * @param inbound A flag to indicate wether the data is coming into the daemon or going out to the user
- * @param user The user record sending the text, when inbound == true.
- */
- virtual void OnServerRaw(std::string &raw, bool inbound, User* user);
+ * system. This is called in all cases -- including when this server will not execute the
+ * rehash because it is directed at a remote server.
+ *
+ * @param user The user performing the rehash, if any. If this is server initiated, the value of
+ * this variable will be NULL.
+ * @param parameter The (optional) parameter given to REHASH from the user. Empty when server
+ * initiated.
+ */
+ virtual void OnPreRehash(User* user, const std::string ¶meter);
+
+ /** Called on rehash.
+ * This method is called when a user initiates a module-specific rehash. This can be used to do
+ * expensive operations (such as reloading SSL certificates) that are not executed on a normal
+ * rehash for efficiency. A rehash of this type does not reload the core configuration.
+ *
+ * @param user The user performing the rehash.
+ * @param parameter The parameter given to REHASH
+ */
+ virtual void OnModuleRehash(User* user, const std::string ¶meter);
+
+ /** Called on rehash.
+ * This method is called after a rehash has completed. You should use it to reload any module
+ * configuration from the main configuration file.
+ * @param user The user that performed the rehash, if it was initiated by a user and that user
+ * is still connected.
+ */
+ virtual void OnRehash(User* user);
+
+ /** Called whenever a snotice is about to be sent to a snomask.
+ * snomask and type may both be modified; the message may not.
+ * @param snomask The snomask the message is going to (e.g. 'A')
+ * @param type The textual description the snomask will go to (e.g. 'OPER')
+ * @param message The text message to be sent via snotice
+ * @return 1 to block the snotice from being sent entirely, 0 else.
+ */
+ virtual int OnSendSnotice(char &snomask, std::string &type, const std::string &message);