mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-09 23:03:13 +02:00
Add HOOKTYPE_IS_HANDSHAKE_FINISHED: if a module returns 0 then register_user()
will not be called. This is used, for example, by m_cap when the CAP LS handshake is still in progress. Modules can add their own requirements as they see fit. Note that, as for (CAP) functionality, this adds nothing new, it just implements it in a cleaner way, rather than all over the place, like in UnrealIRCd 4.x.
This commit is contained in:
+1
-1
@@ -829,7 +829,7 @@ extern int badword_config_process(ConfigItem_badword *ca, char *str);
|
||||
extern void badword_config_free(ConfigItem_badword *ca);
|
||||
extern char *badword_config_check_regex(char *s, int fastsupport, int check_broadness);
|
||||
extern long ClientCapabilityBit(const char *token);
|
||||
extern int user_ready_for_register(aClient *sptr);
|
||||
extern int is_handshake_finished(aClient *sptr);
|
||||
extern void SetCapability(aClient *acptr, const char *token);
|
||||
extern void ClearCapability(aClient *acptr, const char *token);
|
||||
extern void new_message(aClient *sender, MessageTag *recv_mtags, MessageTag **mtag_list);
|
||||
|
||||
+4
-1
@@ -872,6 +872,7 @@ extern char *moddata_client_get(aClient *acptr, char *varname);
|
||||
#define HOOKTYPE_PRE_COMMAND 98
|
||||
#define HOOKTYPE_POST_COMMAND 99
|
||||
#define HOOKTYPE_NEW_MESSAGE 100
|
||||
#define HOOKTYPE_IS_HANDSHAKE_FINISHED 101
|
||||
|
||||
/* Adding a new hook here?
|
||||
* 1) Add the #define HOOKTYPE_.... with a new number
|
||||
@@ -979,6 +980,7 @@ int hooktype_welcome(aClient *sptr, int after_numeric);
|
||||
int hooktype_pre_command(aClient *from, MessageTag *mtags, char *buf);
|
||||
int hooktype_post_command(aClient *from, MessageTag *mtags, char *buf);
|
||||
void hooktype_new_message(aClient *sender, MessageTag *recv_mtags, MessageTag **mtag_list, char *signature);
|
||||
int hooktype_is_handshake_finished(aClient *acptr);
|
||||
|
||||
#ifdef GCC_TYPECHECKING
|
||||
#define ValidateHook(validatefunc, func) __builtin_types_compatible_p(__typeof__(func), __typeof__(validatefunc))
|
||||
@@ -1083,7 +1085,8 @@ _UNREAL_ERROR(_hook_error_incompatible, "Incompatible hook function. Check argum
|
||||
((hooktype == HOOKTYPE_WELCOME) && !ValidateHook(hooktype_welcome, func)) || \
|
||||
((hooktype == HOOKTYPE_PRE_COMMAND) && !ValidateHook(hooktype_pre_command, func)) || \
|
||||
((hooktype == HOOKTYPE_POST_COMMAND) && !ValidateHook(hooktype_post_command, func)) || \
|
||||
((hooktype == HOOKTYPE_NEW_MESSAGE) && !ValidateHook(hooktype_new_message, func)) ) \
|
||||
((hooktype == HOOKTYPE_NEW_MESSAGE) && !ValidateHook(hooktype_new_message, func)) || \
|
||||
((hooktype == HOOKTYPE_IS_HANDSHAKE_FINISHED) && !ValidateHook(hooktype_is_handshake_finished, func)) ) \
|
||||
_hook_error_incompatible();
|
||||
#endif /* GCC_TYPECHECKING */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user