From a93e436b039fa86345759b9a29243fe09fb54bcf Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 25 Aug 2006 13:42:19 +0000 Subject: Add which allows a user to appear to have quit when their host changes, so that clients/bots can stay synched properly. It is recommended this option always be on. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5017 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/users.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/users.cpp') 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::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); -- cgit v1.3.1-10-gc9f91