summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2020-12-22 03:53:00 +0000
committerSadie Powell <sadie@witchery.services>2020-12-22 04:13:56 +0000
commit96befc58f073b4f96771b57d728b16742294c2fe (patch)
tree44be29fcf57e1e5327ac703e30a1c3fa1af90185
parentaa0221d87ca355d5021f81f8f65cf6a47bc93c38 (diff)
Send RPL_SAVENICK from irc2 when renaming a user to their UUID.
-rw-r--r--include/numerics.h1
-rw-r--r--src/modules/m_codepage.cpp3
-rw-r--r--src/modules/m_spanningtree/svsnick.cpp1
-rw-r--r--src/xline.cpp1
4 files changed, 6 insertions, 0 deletions
diff --git a/include/numerics.h b/include/numerics.h
index fa694e214..a34d9b1e1 100644
--- a/include/numerics.h
+++ b/include/numerics.h
@@ -49,6 +49,7 @@ enum
RPL_MAP = 15, // ircu
RPL_ENDMAP = 17, // ircu
RPL_MAPUSERS = 18, // insp-specific
+ RPL_SAVENICK = 43, // From irc2.
RPL_STATS = 210, // From aircd.
RPL_UMODEIS = 221,
diff --git a/src/modules/m_codepage.cpp b/src/modules/m_codepage.cpp
index 7a20e6e52..4054c72c1 100644
--- a/src/modules/m_codepage.cpp
+++ b/src/modules/m_codepage.cpp
@@ -83,7 +83,10 @@ class ModuleCodepage
{
LocalUser* user = *iter;
if (user->nick != user->uuid && !ServerInstance->IsNick(user->nick))
+ {
+ user->WriteNumeric(RPL_SAVENICK, user->uuid, "Your nickname is no longer valid.");
user->ChangeNick(user->uuid);
+ }
}
}
diff --git a/src/modules/m_spanningtree/svsnick.cpp b/src/modules/m_spanningtree/svsnick.cpp
index e9292f445..8d1bc80ba 100644
--- a/src/modules/m_spanningtree/svsnick.cpp
+++ b/src/modules/m_spanningtree/svsnick.cpp
@@ -67,6 +67,7 @@ CmdResult CommandSVSNick::Handle(User* user, Params& parameters)
if (!u->ChangeNick(nick, NickTS))
{
// Changing to 'nick' failed (it may already be in use), change to the uuid
+ u->WriteNumeric(RPL_SAVENICK, u->uuid, "Your nickname is in use by an older user on a new server.");
u->ChangeNick(u->uuid);
}
}
diff --git a/src/xline.cpp b/src/xline.cpp
index 0d627023e..e4c6b6fb3 100644
--- a/src/xline.cpp
+++ b/src/xline.cpp
@@ -688,6 +688,7 @@ bool QLine::Matches(User *u)
void QLine::Apply(User* u)
{
/* Force to uuid on apply of Q-line, no need to disconnect anymore :) */
+ u->WriteNumeric(RPL_SAVENICK, u->uuid, "Your nickname has been Q-lined.");
u->ChangeNick(u->uuid);
}