Only send ACCOUNT and CHGHOST to clients that have sent NICK/USER.

Closes #1657.
This commit is contained in:
Peter Powell 2019-08-01 00:11:12 +01:00
parent c6b5da1f6f
commit 4e3d655dff
2 changed files with 6 additions and 0 deletions

View File

@ -139,6 +139,9 @@ class ModuleIRCv3
void OnAccountChange(User* user, const std::string& newaccount) CXX11_OVERRIDE
{
if (!(user->registered & REG_NICKUSER))
return;
// Logged in: 1 parameter which is the account name
// Logged out: 1 parameter which is a "*"
ClientProtocol::Message msg("ACCOUNT", user);

View File

@ -28,6 +28,9 @@ class ModuleIRCv3ChgHost : public Module
void DoChgHost(User* user, const std::string& ident, const std::string& host)
{
if (!(user->registered & REG_NICKUSER))
return;
ClientProtocol::Message msg("CHGHOST", user);
msg.PushParamRef(ident);
msg.PushParamRef(host);