1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-04 03:23:13 +02:00

Add "CAP chghost" support. Internal recode of userhost changes.

Fix force-rejoin not working if doing SVSMODE -x/+x (Koragg, #5015).

Note to module coders:
Please use the following procedure in case of an user/host change:
* userhost_save_current(acptr);
* << change username or hostname here (or both) >>
* userhost_changed(acptr);
This function will take care of notifying other clients about
the userhost change, such as doing PART+JOIN+MODE if force-rejoin
is enabled, and sending :xx CHGHOST user host messages to
"CAP chghost" capable clients.

Also, small note to everyone:
If force-rejoin is enabled we will not send the PART+JOIN+MODE to
"CAP chghost" capable clients. Doing so is just a hack to notify
people of a userhost change. "CAP chghost" users can thus benefit
from the reduced noise in this respect.
This commit is contained in:
Bram Matthys
2017-10-07 13:31:30 +02:00
parent 0fd265349a
commit 5124e60b7c
15 changed files with 251 additions and 153 deletions
+4 -2
View File
@@ -515,8 +515,6 @@ extern u_char getrandom8();
extern u_int16_t getrandom16();
extern u_int32_t getrandom32();
#define EVENT_DRUGS BASE_VERSION
extern void rejoin_leave(aClient *sptr);
extern void rejoin_joinandmode(aClient *sptr);
extern void ident_failed(aClient *cptr);
extern MODVAR char extchmstr[4][64];
@@ -669,6 +667,8 @@ extern MODVAR int (*check_banned)(aClient *cptr);
extern MODVAR void (*introduce_user)(aClient *to, aClient *acptr);
extern MODVAR int (*check_deny_version)(aClient *cptr, char *version_string, int protocol, char *flags);
extern MODVAR int (*match_user)(char *rmask, aClient *acptr, int options);
extern MODVAR void (*userhost_save_current)(aClient *sptr);
extern MODVAR void (*userhost_changed)(aClient *sptr);
/* /Efuncs */
extern MODVAR aMotdFile opermotd, svsmotd, motd, botmotd, smotd, rules;
@@ -798,3 +798,5 @@ extern int cipher_check(SSL_CTX *ctx, char **errstr);
extern void clicap_pre_rehash(void);
extern void clicap_post_rehash(void);
extern void send_cap_notify(int add, char *token);
extern void sendbufto_one(aClient *to, char *msg, unsigned int quick);
extern MODVAR int current_serial;
+2
View File
@@ -1044,6 +1044,8 @@ _UNREAL_ERROR(_hook_error_incompatible, "Incompatible hook function. Check argum
#define EFUNC_SEND_MODDATA_MEMBERS 51
#define EFUNC_BROADCAST_MODDATA_CLIENT 52
#define EFUNC_MATCH_USER 53
#define EFUNC_USERHOST_SAVE_CURRENT 54
#define EFUNC_USERHOST_CHANGED 55
/* Module flags */
#define MODFLAG_NONE 0x0000
+1
View File
@@ -357,6 +357,7 @@ typedef OperPermission (*OperClassEntryEvalCallback)(OperClassACLEntryVar* varia
#define PROTO_ACCOUNT_NOTIFY 0x200000 /* client supports account-notify */
#define PROTO_MLOCK 0x400000 /* server supports MLOCK */
#define PROTO_EXTSWHOIS 0x800000 /* extended SWHOIS support */
#define PROTO_CAP_CHGHOST 0x1000000 /* CAP chghost */
/*
* flags macros.