aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_ident.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_ident.cpp')
-rw-r--r--src/modules/m_ident.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp
index 9e843bc97..fb2a47762 100644
--- a/src/modules/m_ident.cpp
+++ b/src/modules/m_ident.cpp
@@ -284,7 +284,7 @@ private:
SimpleExtItem<IdentRequestSocket, Cullable::Deleter> socket;
IntExtItem state;
- static void PrefixUser(LocalUser* user)
+ static void PrefixUser(LocalUser* user, const std::string& message = "")
{
// Check that they haven't been prefixed already.
if (user->GetRealUser().front() == '~')
@@ -300,6 +300,9 @@ private:
// Apply the new username.
user->ChangeRealUser(newuser, user->GetDisplayedUser() == user->GetRealUser());
+
+ if (!message.empty())
+ user->WriteNotice("*** {}; using {} instead.", message, user->GetRealUser());
}
public:
@@ -383,8 +386,7 @@ public:
{
/* Ident timeout */
state.Set(user, IDENT_MISSING);
- PrefixUser(user);
- user->WriteNotice("*** Ident lookup timed out, using " + user->GetRealUser() + " instead.");
+ PrefixUser(user, "Ident lookup timed out");
}
else if (!isock->HasResult())
{
@@ -396,8 +398,7 @@ public:
else if (isock->result.empty())
{
state.Set(user, IDENT_MISSING);
- PrefixUser(user);
- user->WriteNotice("*** Could not find your username, using " + user->GetRealUser() + " instead.");
+ PrefixUser(user, "Could not find your username");
}
else
{