1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-10 07:43:12 +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
+6 -4
View File
@@ -110,6 +110,9 @@ CMD_FUNC(m_chghost)
sendnotice(sptr, "*** /ChgHost Error: requested host is same as current host.");
return 0;
}
userhost_save_current(acptr);
switch (UHOST_ALLOWED)
{
case UHALLOW_NEVER:
@@ -130,8 +133,7 @@ CMD_FUNC(m_chghost)
}
break;
case UHALLOW_REJOIN:
rejoin_leave(acptr);
/* join sent later when the host has been changed */
/* rejoin sent later when the host has been changed */
break;
}
@@ -158,9 +160,9 @@ CMD_FUNC(m_chghost)
acptr->user->virthost = 0;
}
acptr->user->virthost = strdup(parv[2]);
if (UHOST_ALLOWED == UHALLOW_REJOIN)
rejoin_joinandmode(acptr);
userhost_changed(acptr);
if (MyClient(acptr))
sendto_one(acptr, err_str(RPL_HOSTHIDDEN), me.name, acptr->name, parv[2]);