summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2018-07-30 18:30:11 +0100
committerPeter Powell <petpow@saberuk.com>2018-07-30 18:30:11 +0100
commit8cb20e354533fbec24aafd4e61ff6fa69b434aa2 (patch)
tree894c77067d6cd443f3ab44b58639b03228079ec8 /src
parent9cf448a332799a138dad0acb5b2878535770571d (diff)
Replace most usages of "GECOS" with "real" or "real name".
Diffstat (limited to 'src')
-rw-r--r--src/configreader.cpp2
-rw-r--r--src/coremods/core_user/cmd_user.cpp2
-rw-r--r--src/coremods/core_whowas.cpp4
-rw-r--r--src/modules.cpp2
-rw-r--r--src/modules/m_chgname.cpp2
-rw-r--r--src/modules/m_setname.cpp2
-rw-r--r--src/modules/m_spanningtree/capab.cpp7
-rw-r--r--src/modules/m_spanningtree/main.cpp4
-rw-r--r--src/modules/m_spanningtree/main.h2
-rw-r--r--src/modules/m_spanningtree/uid.cpp2
-rw-r--r--src/users.cpp10
11 files changed, 21 insertions, 18 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 125bf595d..52d349f5c 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -37,7 +37,7 @@ ServerLimits::ServerLimits(ConfigTag* tag)
, MaxQuit(tag->getUInt("maxquit", 255))
, MaxTopic(tag->getUInt("maxtopic", 307))
, MaxKick(tag->getUInt("maxkick", 255))
- , MaxGecos(tag->getUInt("maxgecos", 128))
+ , MaxReal(tag->getUInt("maxreal", tag->getUInt("maxgecos", 128)))
, MaxAway(tag->getUInt("maxaway", 200))
, MaxLine(tag->getUInt("maxline", 512))
, MaxHost(tag->getUInt("maxhost", 64))
diff --git a/src/coremods/core_user/cmd_user.cpp b/src/coremods/core_user/cmd_user.cpp
index f49b1339c..75fab929f 100644
--- a/src/coremods/core_user/cmd_user.cpp
+++ b/src/coremods/core_user/cmd_user.cpp
@@ -48,7 +48,7 @@ CmdResult CommandUser::HandleLocal(LocalUser* user, const Params& parameters)
else
{
user->ChangeIdent(parameters[0]);
- user->fullname.assign(parameters[3].empty() ? "No info" : parameters[3], 0, ServerInstance->Config->Limits.MaxGecos);
+ user->fullname.assign(parameters[3].empty() ? "No info" : parameters[3], 0, ServerInstance->Config->Limits.MaxReal);
user->registered = (user->registered | REG_USER);
}
}
diff --git a/src/coremods/core_whowas.cpp b/src/coremods/core_whowas.cpp
index 6bcf6448b..73251b442 100644
--- a/src/coremods/core_whowas.cpp
+++ b/src/coremods/core_whowas.cpp
@@ -62,7 +62,7 @@ CmdResult CommandWhowas::Handle(User* user, const Params& parameters)
{
WhoWas::Entry* u = *i;
- user->WriteNumeric(RPL_WHOWASUSER, parameters[0], u->ident, u->dhost, '*', u->gecos);
+ user->WriteNumeric(RPL_WHOWASUSER, parameters[0], u->ident, u->dhost, '*', u->real);
if (user->HasPrivPermission("users/auspex"))
user->WriteNumeric(RPL_WHOWASIP, parameters[0], InspIRCd::Format("was connecting from *@%s", u->host.c_str()));
@@ -245,7 +245,7 @@ WhoWas::Entry::Entry(User* user)
, dhost(user->GetDisplayedHost())
, ident(user->ident)
, server(user->server->GetName())
- , gecos(user->fullname)
+ , real(user->fullname)
, signon(user->signon)
{
}
diff --git a/src/modules.cpp b/src/modules.cpp
index 334111e6d..7e602d944 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -109,7 +109,7 @@ ModResult Module::OnCheckChannelBan(User*, Channel*) { DetachEvent(I_OnCheckChan
ModResult Module::OnCheckBan(User*, Channel*, const std::string&) { DetachEvent(I_OnCheckBan); return MOD_RES_PASSTHRU; }
ModResult Module::OnExtBanCheck(User*, Channel*, char) { DetachEvent(I_OnExtBanCheck); return MOD_RES_PASSTHRU; }
ModResult Module::OnChangeLocalUserHost(LocalUser*, const std::string&) { DetachEvent(I_OnChangeLocalUserHost); return MOD_RES_PASSTHRU; }
-ModResult Module::OnChangeLocalUserGECOS(LocalUser*, const std::string&) { DetachEvent(I_OnChangeLocalUserGECOS); return MOD_RES_PASSTHRU; }
+ModResult Module::OnPreChangeRealName(LocalUser*, const std::string&) { DetachEvent(I_OnPreChangeRealName); return MOD_RES_PASSTHRU; }
ModResult Module::OnPreTopicChange(User*, Channel*, const std::string&) { DetachEvent(I_OnPreTopicChange); return MOD_RES_PASSTHRU; }
ModResult Module::OnPassCompare(Extensible* ex, const std::string &password, const std::string &input, const std::string& hashtype) { DetachEvent(I_OnPassCompare); return MOD_RES_PASSTHRU; }
void Module::OnPostConnect(User*) { DetachEvent(I_OnPostConnect); }
diff --git a/src/modules/m_chgname.cpp b/src/modules/m_chgname.cpp
index fa35732b8..d0a4d6fdc 100644
--- a/src/modules/m_chgname.cpp
+++ b/src/modules/m_chgname.cpp
@@ -49,7 +49,7 @@ class CommandChgname : public Command
return CMD_FAILURE;
}
- if (parameters[1].length() > ServerInstance->Config->Limits.MaxGecos)
+ if (parameters[1].length() > ServerInstance->Config->Limits.MaxReal)
{
user->WriteNotice("*** CHGNAME: Real name is too long");
return CMD_FAILURE;
diff --git a/src/modules/m_setname.cpp b/src/modules/m_setname.cpp
index 3bede1ad2..bc2b0f3d9 100644
--- a/src/modules/m_setname.cpp
+++ b/src/modules/m_setname.cpp
@@ -34,7 +34,7 @@ class CommandSetname : public Command
CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE
{
- if (parameters[0].size() > ServerInstance->Config->Limits.MaxGecos)
+ if (parameters[0].size() > ServerInstance->Config->Limits.MaxReal)
{
user->WriteNotice("*** SETNAME: Real name is too long");
return CMD_FAILURE;
diff --git a/src/modules/m_spanningtree/capab.cpp b/src/modules/m_spanningtree/capab.cpp
index 97b4a90af..342945c3a 100644
--- a/src/modules/m_spanningtree/capab.cpp
+++ b/src/modules/m_spanningtree/capab.cpp
@@ -163,9 +163,12 @@ void TreeSocket::SendCapabilities(int phase)
extra = " CHALLENGE=" + this->GetOurChallenge();
}
- // 2.0 needs this key
+ // 2.0 needs these keys.
if (proto_version == 1202)
+ {
extra.append(" PROTOCOL="+ConvToStr(ProtocolVersion));
+ extra.append(" MAXGECOS="+ConvToStr(ServerInstance->Config->Limits.MaxReal));
+ }
this->WriteLine("CAPAB CAPABILITIES " /* Preprocessor does this one. */
":NICKMAX="+ConvToStr(ServerInstance->Config->Limits.NickMax)+
@@ -175,7 +178,7 @@ void TreeSocket::SendCapabilities(int phase)
" MAXQUIT="+ConvToStr(ServerInstance->Config->Limits.MaxQuit)+
" MAXTOPIC="+ConvToStr(ServerInstance->Config->Limits.MaxTopic)+
" MAXKICK="+ConvToStr(ServerInstance->Config->Limits.MaxKick)+
- " MAXGECOS="+ConvToStr(ServerInstance->Config->Limits.MaxGecos)+
+ " MAXREAL="+ConvToStr(ServerInstance->Config->Limits.MaxReal)+
" MAXAWAY="+ConvToStr(ServerInstance->Config->Limits.MaxAway)+
" MAXHOST="+ConvToStr(ServerInstance->Config->Limits.MaxHost)+
extra+
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 0d153737f..344a6088b 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -493,12 +493,12 @@ void ModuleSpanningTree::OnChangeHost(User* user, const std::string &newhost)
CmdBuilder(user, "FHOST").push(newhost).Broadcast();
}
-void ModuleSpanningTree::OnChangeName(User* user, const std::string &gecos)
+void ModuleSpanningTree::OnChangeName(User* user, const std::string& real)
{
if (user->registered != REG_ALL || !IS_LOCAL(user))
return;
- CmdBuilder(user, "FNAME").push_last(gecos).Broadcast();
+ CmdBuilder(user, "FNAME").push_last(real).Broadcast();
}
void ModuleSpanningTree::OnChangeIdent(User* user, const std::string &ident)
diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h
index 20c1ac2b9..b6374e32e 100644
--- a/src/modules/m_spanningtree/main.h
+++ b/src/modules/m_spanningtree/main.h
@@ -152,7 +152,7 @@ class ModuleSpanningTree : public Module, public Stats::EventListener
void OnBackgroundTimer(time_t curtime) CXX11_OVERRIDE;
void OnUserJoin(Membership* memb, bool sync, bool created, CUList& excepts) CXX11_OVERRIDE;
void OnChangeHost(User* user, const std::string &newhost) CXX11_OVERRIDE;
- void OnChangeName(User* user, const std::string &gecos) CXX11_OVERRIDE;
+ void OnChangeName(User* user, const std::string& real) CXX11_OVERRIDE;
void OnChangeIdent(User* user, const std::string &ident) CXX11_OVERRIDE;
void OnUserPart(Membership* memb, std::string &partmessage, CUList& excepts) CXX11_OVERRIDE;
void OnUserQuit(User* user, const std::string &reason, const std::string &oper_message) CXX11_OVERRIDE;
diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp
index f9cff6c0d..86933dc72 100644
--- a/src/modules/m_spanningtree/uid.cpp
+++ b/src/modules/m_spanningtree/uid.cpp
@@ -30,7 +30,7 @@ CmdResult CommandUID::HandleServer(TreeServer* remoteserver, CommandBase::Params
{
/**
* 0 1 2 3 4 5 6 7 8 9 (n-1)
- * UID uuid age nick host dhost ident ip.string signon +modes (modepara) :gecos
+ * UID uuid age nick host dhost ident ip.string signon +modes (modepara) :real
*/
time_t age_t = ServerCommand::ExtractTS(params[1]);
time_t signon = ServerCommand::ExtractTS(params[7]);
diff --git a/src/users.cpp b/src/users.cpp
index 81e6512a1..20480da07 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -995,20 +995,20 @@ bool User::SharesChannelWith(User *other)
return false;
}
-bool User::ChangeName(const std::string& gecos)
+bool User::ChangeName(const std::string& real)
{
- if (!this->fullname.compare(gecos))
+ if (!this->fullname.compare(real))
return true;
if (IS_LOCAL(this))
{
ModResult MOD_RESULT;
- FIRST_MOD_RESULT(OnChangeLocalUserGECOS, MOD_RESULT, (IS_LOCAL(this),gecos));
+ FIRST_MOD_RESULT(OnPreChangeRealName, MOD_RESULT, (IS_LOCAL(this), real));
if (MOD_RESULT == MOD_RES_DENY)
return false;
- FOREACH_MOD(OnChangeName, (this,gecos));
+ FOREACH_MOD(OnChangeName, (this, real));
}
- this->fullname.assign(gecos, 0, ServerInstance->Config->Limits.MaxGecos);
+ this->fullname.assign(real, 0, ServerInstance->Config->Limits.MaxReal);
return true;
}