summaryrefslogtreecommitdiff
path: root/src/users.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-25 20:18:43 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-25 20:18:43 +0000
commit8a7ee30ce6f5cc762619556b042182b7e7b57ba2 (patch)
treed1da360dc96e5708e5f9af9d044ce66c51665057 /src/users.cpp
parent1a124bb23ab6b04ced9e2fb762423a0260882841 (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
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp16
1 files changed, 9 insertions, 7 deletions
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());
}
}
}