mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-07 22:43:12 +02:00
- Fixed some case insensitive checks in configfile parsing, fixed to be case sensitive.
- Module changes: added two hooks: HOOKTYPE_USERMSG and HOOKTYPE_CHANMSG, changed umode_get. The HOOKTYPE_USERMSG has been tested with a +D (deaf for private msgs except for opers) module, the channel thing not yet... added global/local mode flag to umode_get, or use umode_lget (local) / umode_gget (global) :P. Blah.
This commit is contained in:
+5
-1
@@ -335,7 +335,9 @@ extern int m_umode(aClient *, aClient *, int, char **);
|
||||
extern int m_names(aClient *, aClient *, int, char **);
|
||||
extern int m_server_estab(aClient *);
|
||||
extern void umode_init(void);
|
||||
extern long umode_get(char ch);
|
||||
extern long umode_get(char, int);
|
||||
#define umode_lget(x) umode_get(x, 0);
|
||||
#define umode_gget(x) umode_get(x, 1);
|
||||
extern int umode_delete(char ch, long val);
|
||||
extern void send_umode(aClient *, aClient *, long, long, char *);
|
||||
extern void send_umode_out(aClient *, aClient *, long);
|
||||
@@ -425,6 +427,8 @@ extern long UMODE_HIDEOPER; /* 0x20000000 Hide oper mode */
|
||||
extern long UMODE_SETHOST; /* 0x40000000 used sethost */
|
||||
extern long UMODE_STRIPBADWORDS; /* 0x80000000 */
|
||||
|
||||
extern long AllUmodes, SendUmodes;
|
||||
|
||||
#ifndef HAVE_STRLCPY
|
||||
size_t strlcpy(char *dst, const char *src, size_t size);
|
||||
#endif
|
||||
|
||||
+13
-7
@@ -116,6 +116,7 @@ struct _irchook {
|
||||
union {
|
||||
int (*intfunc)();
|
||||
void (*voidfunc)();
|
||||
char *(*pcharfunc)();
|
||||
} func;
|
||||
Module *owner;
|
||||
};
|
||||
@@ -223,14 +224,16 @@ int Module_free(Module *mod);
|
||||
void *obsd_dlsym(void *handle, char *symbol);
|
||||
#endif
|
||||
|
||||
#define add_Hook(hooktype, func) HookAddMain(NULL, hooktype, func, NULL)
|
||||
#define HookAdd(hooktype, func) HookAddMain(NULL, hooktype, func, NULL)
|
||||
#define HookAddEx(module, hooktype, func) HookAddMain(module, hooktype, func, NULL)
|
||||
#define HookAddVoid(hooktype, func) HookAddMain(NULL, hooktype, NULL, func)
|
||||
#define HookAddVoidEx(module, hooktype, func) HookAddMain(module, hooktype, NULL, func)
|
||||
#define add_HookX(hooktype, func1, func2) HookAddMain(NULL, hooktype, func1, func2)
|
||||
#define add_Hook(hooktype, func) HookAddMain(NULL, hooktype, func, NULL, NULL)
|
||||
#define HookAdd(hooktype, func) HookAddMain(NULL, hooktype, func, NULL, NULL)
|
||||
#define HookAddEx(module, hooktype, func) HookAddMain(module, hooktype, func, NULL, NULL)
|
||||
#define HookAddVoid(hooktype, func) HookAddMain(NULL, hooktype, NULL, func, NULL)
|
||||
#define HookAddVoidEx(module, hooktype, func) HookAddMain(module, hooktype, NULL, func, NULL)
|
||||
#define HookAddPChar(hooktype, func) HookAddMain(NULL, hooktype, NULL, NULL, func)
|
||||
#define HookAddPCharEx(module, hooktype, func) HookAddMain(module, hooktype, NULL, NULL, func)
|
||||
#define add_HookX(hooktype, func1, func2, func3) HookAddMain(NULL, hooktype, func1, func2, func3)
|
||||
|
||||
Hook *HookAddMain(Module *module, int hooktype, int (*intfunc)(), void (*voidfunc)());
|
||||
Hook *HookAddMain(Module *module, int hooktype, int (*intfunc)(), void (*voidfunc)(), char *(*pcharfunc)());
|
||||
Hook *HookDel(Hook *hook);
|
||||
|
||||
Hooktype *HooktypeAdd(Module *module, char *string, int *type);
|
||||
@@ -262,6 +265,9 @@ void CommandDel(Command *command);
|
||||
#define HOOKTYPE_LOCAL_JOIN 14
|
||||
#define HOOKTYPE_CONFIGTEST 15
|
||||
#define HOOKTYPE_CONFIGRUN 16
|
||||
#define HOOKTYPE_USERMSG 17
|
||||
#define HOOKTYPE_CHANMSG 18
|
||||
|
||||
/* Module flags */
|
||||
#define MODFLAG_NONE 0x0000
|
||||
#define MODFLAG_LOADED 0x0001 /* Fully loaded */
|
||||
|
||||
+4
-2
@@ -321,8 +321,10 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
|
||||
|
||||
#define SNO_NONOPERS (SNO_KILLS | SNO_SNOTICE)
|
||||
|
||||
#define SEND_UMODES (UMODE_INVISIBLE|UMODE_OPER|UMODE_WALLOP|UMODE_FAILOP|UMODE_HELPOP|UMODE_RGSTRONLY|UMODE_REGNICK|UMODE_SADMIN|UMODE_NETADMIN|UMODE_COADMIN|UMODE_ADMIN|UMODE_SERVICES|UMODE_HIDE|UMODE_WHOIS|UMODE_KIX|UMODE_BOT|UMODE_SECURE|UMODE_DEAF|UMODE_VICTIM|UMODE_HIDEOPER|UMODE_SETHOST|UMODE_STRIPBADWORDS|UMODE_WEBTV)
|
||||
#define ALL_UMODES (SEND_UMODES|UMODE_SERVNOTICE|UMODE_LOCOP|UMODE_SERVICES)
|
||||
#define SEND_UMODES (SendUmodes)
|
||||
#define ALL_UMODES (AllUmodes)
|
||||
/* SEND_UMODES and ALL_UMODES are now handled by umode_get/umode_lget/umode_gget -- Syzop. */
|
||||
|
||||
#define FLAGS_ID (FLAGS_DOID|FLAGS_GOTID)
|
||||
|
||||
#define PROTO_NOQUIT 0x1 /* Negotiated NOQUIT protocol */
|
||||
|
||||
Reference in New Issue
Block a user