mirror of
https://github.com/anope/anope.git
synced 2026-07-05 00:13:13 +02:00
Automatically destruct messages when modules are unloaded
This commit is contained in:
@@ -304,20 +304,6 @@ namespace Anope
|
||||
*/
|
||||
extern CoreExport bool Match(const Anope::string &str, const Anope::string &mask, bool case_sensitive = false);
|
||||
|
||||
/** Add a message to Anope
|
||||
* @param name The message name as sent by the IRCd
|
||||
* @param func A callback function that will be called when this message is received
|
||||
* @return The new message object
|
||||
*/
|
||||
extern CoreExport Message *AddMessage(const string &name, bool (*func)(const string &source, const std::vector<Anope::string> ¶ms));
|
||||
|
||||
/** Deletes a message from Anope
|
||||
* XXX Im not sure what will happen if this function is called indirectly from message function pointed to by this message.. must check
|
||||
* @param m The message
|
||||
* @return true if the message was found and deleted, else false
|
||||
*/
|
||||
extern CoreExport bool DelMessage(Message *m);
|
||||
|
||||
/** Returns a list of pointers to message handlers
|
||||
* @param The message name as sent by the IRCd
|
||||
* @return a vector with pointers to the messagehandlers (you can bind more than one handler to a message)
|
||||
|
||||
@@ -1269,6 +1269,9 @@ struct Message
|
||||
{
|
||||
Anope::string name;
|
||||
bool (*func)(const Anope::string &source, const std::vector<Anope::string> ¶ms);
|
||||
|
||||
Message(const Anope::string &n, bool (*f)(const Anope::string &, const std::vector<Anope::string> &));
|
||||
~Message();
|
||||
};
|
||||
|
||||
#endif // MODULES_H
|
||||
|
||||
Reference in New Issue
Block a user