summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-09 22:14:26 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-09 22:14:26 +0000
commit0bb5b62bfb18d033ef03932f6ea8fe7a366c1b92 (patch)
treeabd9de36ed7ae290f37176fa89cb069a685b34b5
parent1dc9fc8f1a72993cd7a13ccb4db94e58ed4793a3 (diff)
Added Spacify() function local to cmd_whois.cpp which translates _ in oper names to " "
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4254 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/cmd_whois.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/cmd_whois.cpp b/src/cmd_whois.cpp
index 4caf0b783..138589237 100644
--- a/src/cmd_whois.cpp
+++ b/src/cmd_whois.cpp
@@ -30,6 +30,16 @@ extern ModuleList modules;
extern FactoryList factory;
extern time_t TIME;
+const char* Spacify(char* n)
+{
+ static char x[MAXBUF];
+ strlcpy(x,n,MAXBUF);
+ for (char* y = x; *y; y++)
+ if (*y == '_')
+ *y = ' ';
+ return x;
+}
+
void do_whois(userrec* user, userrec* dest,unsigned long signon, unsigned long idle, const char* nick)
{
// bug found by phidjit - were able to whois an incomplete connection if it had sent a NICK or USER
@@ -66,7 +76,7 @@ void do_whois(userrec* user, userrec* dest,unsigned long signon, unsigned long i
}
if (*dest->oper)
{
- WriteServ(user->fd,"313 %s %s :is %s %s on %s",user->nick, dest->nick, (strchr("AEIOUaeiou",*dest->oper) ? "an" : "a"),dest->oper, Config->Network);
+ WriteServ(user->fd,"313 %s %s :is %s %s on %s",user->nick, dest->nick, (strchr("AEIOUaeiou",*dest->oper) ? "an" : "a"),Spacify(dest->oper), Config->Network);
}
if ((!signon) && (!idle))
{