diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-25 20:18:43 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-25 20:18:43 +0000 |
commit | 8a7ee30ce6f5cc762619556b042182b7e7b57ba2 (patch) | |
tree | d1da360dc96e5708e5f9af9d044ce66c51665057 | |
parent | 1a124bb23ab6b04ced9e2fb762423a0260882841 (diff) |
Fix changing of idents and hosts (it wasnt working -- in fact WriteCommon was sort of BROKEN AS HELL)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5023 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/modules/m_chgident.cpp | 2 | ||||
-rw-r--r-- | src/users.cpp | 16 |
2 files changed, 10 insertions, 8 deletions
diff --git a/src/modules/m_chgident.cpp b/src/modules/m_chgident.cpp index 3eab361a1..a658e1793 100644 --- a/src/modules/m_chgident.cpp +++ b/src/modules/m_chgident.cpp @@ -11,7 +11,7 @@ class cmd_chgident : public command_t { public: - cmd_chgident (InspIRCd* Instance) : command_t(Instance,"CHGIDENT", 'o', 2) + cmd_chgident (InspIRCd* Instance) : command_t(Instance,"CHGIDENT", 'o', 2) { this->source = "m_chgident.so"; syntax = "<nick> <newident>"; diff --git a/src/users.cpp b/src/users.cpp index 0a213c429..09a8c37a5 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1460,7 +1460,7 @@ void userrec::WriteCommonExcept(const char* text, ...) void userrec::WriteCommonExcept(const std::string &text) { - bool quit_munge = true; + bool quit_munge = false; char oper_quit[MAXBUF]; char textbuffer[MAXBUF]; @@ -1633,7 +1633,7 @@ bool userrec::ChangeDisplayedHost(const char* host) FOREACH_MOD(I_OnChangeHost,OnChangeHost(this,host)); } if (this->ServerInstance->Config->CycleHosts) - this->WriteCommonExcept("QUIT :Changing hosts"); + this->WriteCommonExcept("%s","QUIT :Changing hosts"); strlcpy(this->dhost,host,63); @@ -1644,8 +1644,9 @@ bool userrec::ChangeDisplayedHost(const char* host) 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()); + std::string n = this->ServerInstance->Modes->ModeString(this, (*i)->channel); + if (n.length()) + (*i)->channel->WriteChannelWithServ(this->ServerInstance->Config->ServerName, "MODE %s +%s", (*i)->channel->name, n.c_str()); } } } @@ -1659,7 +1660,7 @@ bool userrec::ChangeDisplayedHost(const char* host) bool userrec::ChangeIdent(const char* newident) { if (this->ServerInstance->Config->CycleHosts) - this->WriteCommonExcept("QUIT :Changing ident"); + this->WriteCommonExcept("%s","QUIT :Changing ident"); strlcpy(this->ident, newident, IDENTMAX+2); @@ -1670,8 +1671,9 @@ bool userrec::ChangeIdent(const char* newident) 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()); + std::string n = this->ServerInstance->Modes->ModeString(this, (*i)->channel); + if (n.length()) + (*i)->channel->WriteChannelWithServ(this->ServerInstance->Config->ServerName, "MODE %s +%s", (*i)->channel->name, n.c_str()); } } } |