aboutsummaryrefslogtreecommitdiffstats
path: root/src/users.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/users.cpp b/src/users.cpp
index 085440367..031333dfc 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -1632,8 +1632,24 @@ bool userrec::ChangeDisplayedHost(const char* host)
return false;
FOREACH_MOD(I_OnChangeHost,OnChangeHost(this,host));
}
+ if (this->ServerInstance->Config->CycleHosts)
+ this->WriteCommonExcept("QUIT :Changing hosts");
+
strlcpy(this->dhost,host,63);
+ if (this->ServerInstance->Config->CycleHosts)
+ {
+ for (std::vector<ucrec*>::const_iterator i = this->chans.begin(); i != this->chans.end(); i++)
+ {
+ if ((*i)->channel)
+ {
+ (*i)->channel->WriteAllExceptSender(this, 0, "JOIN %s", (*i)->channel->name);
+ (*i)->channel->WriteChannelWithServ(this->ServerInstance->Config->ServerName, "MODE %s +%s",
+ (*i)->channel->name, this->ServerInstance->Modes->ModeString(this, (*i)->channel).c_str());
+ }
+ }
+ }
+
if (IS_LOCAL(this))
this->WriteServ("396 %s %s :is now your hidden host",this->nick,this->dhost);