1
0
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:
Adam
2010-10-04 16:38:25 -04:00
parent cf98cd3e06
commit ab5ebc2245
11 changed files with 142 additions and 312 deletions
-14
View File
@@ -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> &params));
/** 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)
+3
View File
@@ -1269,6 +1269,9 @@ struct Message
{
Anope::string name;
bool (*func)(const Anope::string &source, const std::vector<Anope::string> &params);
Message(const Anope::string &n, bool (*f)(const Anope::string &, const std::vector<Anope::string> &));
~Message();
};
#endif // MODULES_H