summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/conf/inspircd.conf.example4
-rw-r--r--docs/conf/modules.conf.example2
-rw-r--r--include/commands/cmd_whowas.h4
-rw-r--r--include/configreader.h4
-rw-r--r--include/modules.h22
-rw-r--r--include/modules/sql.h2
-rw-r--r--include/users.h6
-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
18 files changed, 43 insertions, 40 deletions
diff --git a/docs/conf/inspircd.conf.example b/docs/conf/inspircd.conf.example
index d1e752840..12fc613aa 100644
--- a/docs/conf/inspircd.conf.example
+++ b/docs/conf/inspircd.conf.example
@@ -836,8 +836,8 @@
# maxkick: Maximum length of a kick message.
maxkick="255"
- # maxgecos: Maximum length of a real name (gecos).
- maxgecos="128"
+ # maxreal: Maximum length of a real name.
+ maxreal="128"
# maxaway: Maximum length of an away message.
maxaway="200">
diff --git a/docs/conf/modules.conf.example b/docs/conf/modules.conf.example
index c8fd94c06..6c3357d29 100644
--- a/docs/conf/modules.conf.example
+++ b/docs/conf/modules.conf.example
@@ -819,7 +819,7 @@
#<module name="flashpolicyd"> #
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
-# Gecos (real name) ban: Implements extended ban 'r', which stops anyone
+# Real name ban: Implements extended ban 'r', which stops anyone
# matching a mask like +b r:*realname?here* from joining a channel.
#<module name="gecosban">
diff --git a/include/commands/cmd_whowas.h b/include/commands/cmd_whowas.h
index 6af0c7c55..2447024a1 100644
--- a/include/commands/cmd_whowas.h
+++ b/include/commands/cmd_whowas.h
@@ -45,9 +45,9 @@ namespace WhoWas
*/
const std::string server;
- /** Full name (GECOS)
+ /** Real name
*/
- const std::string gecos;
+ const std::string real;
/** Signon time
*/
diff --git a/include/configreader.h b/include/configreader.h
index b603f2e10..81ec014a0 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -103,8 +103,8 @@ class ServerLimits
size_t MaxTopic;
/** Maximum kick message length */
size_t MaxKick;
- /** Maximum GECOS (real name) length */
- size_t MaxGecos;
+ /** Maximum real name length */
+ size_t MaxReal;
/** Maximum away message length */
size_t MaxAway;
/** Maximum line length */
diff --git a/include/modules.h b/include/modules.h
index 432e70752..302c2e4d7 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -222,7 +222,7 @@ enum Implementation
I_OnRawMode, I_OnCheckKey, I_OnCheckLimit, I_OnCheckBan, I_OnCheckChannelBan, I_OnExtBanCheck,
I_OnChangeLocalUserHost, I_OnPreTopicChange,
I_OnPostTopicChange, I_OnPostConnect, I_OnPostDeoper,
- I_OnChangeLocalUserGECOS, I_OnUserRegister, I_OnChannelPreDelete, I_OnChannelDelete,
+ I_OnPreChangeRealName, I_OnUserRegister, I_OnChannelPreDelete, I_OnChannelDelete,
I_OnPostOper, I_OnSetAway, I_OnPostCommand, I_OnPostJoin,
I_OnBuildNeighborList, I_OnGarbageCollect, I_OnSetConnectClass,
I_OnUserMessage, I_OnPassCompare, I_OnNamesListItem, I_OnNumeric,
@@ -580,12 +580,12 @@ class CoreExport Module : public classbase, public usecountbase
*/
virtual void OnChangeHost(User* user, const std::string &newhost);
- /** Called whenever a user's GECOS (realname) is changed.
+ /** Called whenever a user's real name is changed.
* This event triggers after the name has been set.
- * @param user The user who's GECOS is being changed
- * @param gecos The new GECOS being set on the user
+ * @param user The user who's real name is being changed
+ * @param name The new real name being set on the user
*/
- virtual void OnChangeName(User* user, const std::string &gecos);
+ virtual void OnChangeName(User* user, const std::string& real);
/** Called whenever a user's IDENT is changed.
* This event triggers after the name has been set.
@@ -841,13 +841,13 @@ class CoreExport Module : public classbase, public usecountbase
*/
virtual ModResult OnChangeLocalUserHost(LocalUser* user, const std::string &newhost);
- /** Called whenever a change of a local users GECOS (fullname field) is attempted.
- * return 1 to deny the name change, or 0 to allow it.
- * @param user The user whos GECOS will be changed
- * @param newhost The new GECOS
- * @return 1 to deny the GECOS change, 0 to allow
+ /** Called whenever a change of a local users real name is attempted.
+ * return MOD_RES_DENY to deny the name change, or MOD_RES_ALLOW to allow it.
+ * @param user The user whos real name will be changed
+ * @param newhost The new real name.
+ * @return MOD_RES_DENY to deny the real name change, MOD_RES_ALLOW to allow
*/
- virtual ModResult OnChangeLocalUserGECOS(LocalUser* user, const std::string &newhost);
+ virtual ModResult OnPreChangeRealName(LocalUser* user, const std::string &newhost);
/** Called before a topic is changed.
* Return 1 to deny the topic change, 0 to check details on the change, -1 to let it through with no checks
diff --git a/include/modules/sql.h b/include/modules/sql.h
index 59955107d..1f5bb7ff3 100644
--- a/include/modules/sql.h
+++ b/include/modules/sql.h
@@ -260,7 +260,7 @@ inline void SQL::PopulateUserInfo(User* user, ParamMap& userinfo)
userinfo["nick"] = user->nick;
userinfo["host"] = user->GetRealHost();
userinfo["ip"] = user->GetIPString();
- userinfo["gecos"] = user->fullname;
+ userinfo["real"] = user->fullname;
userinfo["ident"] = user->ident;
userinfo["server"] = user->server->GetName();
userinfo["uuid"] = user->uuid;
diff --git a/include/users.h b/include/users.h
index 88858b160..bcddab1bf 100644
--- a/include/users.h
+++ b/include/users.h
@@ -308,7 +308,7 @@ class CoreExport User : public Extensible
*/
std::string ident;
- /** The users full name (GECOS).
+ /** The users full name.
*/
std::string fullname;
@@ -707,10 +707,10 @@ class CoreExport User : public Extensible
* ALWAYS use this function, rather than writing User::fullname directly,
* as this triggers module events allowing the change to be syncronized to
* remote servers.
- * @param gecos The user's new realname
+ * @param real The user's new real name
* @return True if the change succeeded, false if otherwise
*/
- bool ChangeName(const std::string& gecos);
+ bool ChangeName(const std::string& real);
/** Change a user's nick
* @param newnick The new nick. If equal to the users uuid, the nick change always succeeds.
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;
}