From ee7ac5aaede95eb82ecc948d0e52ad01ddeaa6c9 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Wed, 18 Oct 2017 12:41:37 +0100 Subject: Clean up OnCleanup. - Switch to using ExtensionItem::ExtensibleType for the type instead of TargetTypeFlags. - Pass the extensible to OnCleanup as an Extensible pointer instead of a void pointer. - Call OnCleanup for memberships as well as channels and users. - Rewrite event documentation to remove outdated references. --- include/modules.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/modules.h b/include/modules.h index 3ad0258b8..2481f8207 100644 --- a/include/modules.h +++ b/include/modules.h @@ -649,16 +649,15 @@ class CoreExport Module : public classbase, public usecountbase */ virtual void OnExpireLine(XLine *line); - /** Called before your module is unloaded to clean up Extensibles. - * This method is called once for every user and channel on the network, - * so that when your module unloads it may clear up any remaining data - * in the form of Extensibles added using Extensible::Extend(). - * If the target_type variable is TYPE_USER, then void* item refers to - * a User*, otherwise it refers to a Channel*. - * @param target_type The type of item being cleaned - * @param item A pointer to the item's class - */ - virtual void OnCleanup(int target_type, void* item); + /** Called before the module is unloaded to clean up extensibles. + * This method is called once for every channel, membership, and user. + * so that you can clear up any data relating to the specified extensible. + * @param type The type of extensible being cleaned up. If this is EXT_CHANNEL + * then item is a Channel*, EXT_MEMBERSHIP then item is a Membership*, + * and EXT_USER then item is a User*. + * @param item A pointer to the extensible which is being cleaned up. + */ + virtual void OnCleanup(ExtensionItem::ExtensibleType type, Extensible* item); /** Called after any nickchange, local or remote. This can be used to track users after nickchanges * have been applied. Please note that although you can see remote nickchanges through this function, you should -- cgit v1.2.3