From 1164ae11b22509889203fbcbe114f67191deeed4 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 25 May 2005 14:49:25 +0000 Subject: Fixed to never append double sums git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1513 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/helperfuncs.cpp | 42 +++++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index b4f4b77a0..8f899e153 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -601,7 +601,11 @@ bool CommonOnThisServer(userrec* u,const char* servername) void NetSendToCommon(userrec* u, char* s) { char buffer[MAXBUF]; - snprintf(buffer,MAXBUF,"%s %s",CreateSum().c_str(),s); + if (*s == ':') + { + snprintf(buffer,MAXBUF,"%s",s); + } + else snprintf(buffer,MAXBUF,"%s %s",CreateSum().c_str(),s); log(DEBUG,"NetSendToCommon: '%s' '%s'",u->nick,s); @@ -628,7 +632,11 @@ void NetSendToCommon(userrec* u, char* s) void NetSendToAll(char* s) { char buffer[MAXBUF]; - snprintf(buffer,MAXBUF,"%s %s",CreateSum().c_str(),s); + if (*s == ':') + { + snprintf(buffer,MAXBUF,"%s",s); + } + else snprintf(buffer,MAXBUF,"%s %s",CreateSum().c_str(),s); log(DEBUG,"NetSendToAll: '%s'",s); @@ -652,7 +660,11 @@ void NetSendToAll(char* s) void NetSendToAll_WithSum(char* s,char* u) { char buffer[MAXBUF]; - snprintf(buffer,MAXBUF,":%s %s",u,s); + if (*s == ':') + { + snprintf(buffer,MAXBUF,"%s",s); + } + else snprintf(buffer,MAXBUF,":%s %s",u,s); log(DEBUG,"NetSendToAll: '%s'",s); @@ -675,7 +687,11 @@ void NetSendToAll_WithSum(char* s,char* u) void NetSendToAllAlive(char* s) { char buffer[MAXBUF]; - snprintf(buffer,MAXBUF,"%s %s",CreateSum().c_str(),s); + if (*s == ':') + { + snprintf(buffer,MAXBUF,"%s",s); + } + else snprintf(buffer,MAXBUF,"%s %s",CreateSum().c_str(),s); log(DEBUG,"NetSendToAllAlive: '%s'",s); @@ -706,7 +722,11 @@ void NetSendToAllAlive(char* s) void NetSendToOne(char* target,char* s) { char buffer[MAXBUF]; - snprintf(buffer,MAXBUF,"%s %s",CreateSum().c_str(),s); + if (*s == ':') + { + snprintf(buffer,MAXBUF,"%s",s); + } + else snprintf(buffer,MAXBUF,"%s %s",CreateSum().c_str(),s); log(DEBUG,"NetSendToOne: '%s' '%s'",target,s); @@ -732,7 +752,11 @@ void NetSendToOne(char* target,char* s) void NetSendToAllExcept(const char* target,char* s) { char buffer[MAXBUF]; - snprintf(buffer,MAXBUF,"%s %s",CreateSum().c_str(),s); + if (*s == ':') + { + snprintf(buffer,MAXBUF,"%s",s); + } + else snprintf(buffer,MAXBUF,"%s %s",CreateSum().c_str(),s); log(DEBUG,"NetSendToAllExcept: '%s' '%s'",target,s); @@ -758,7 +782,11 @@ void NetSendToAllExcept(const char* target,char* s) void NetSendToAllExcept_WithSum(const char* target,char* s,char* u) { char buffer[MAXBUF]; - snprintf(buffer,MAXBUF,":%s %s",u,s); + if (*s == ':') + { + snprintf(buffer,MAXBUF,"%s",s); + } + else snprintf(buffer,MAXBUF,":%s %s",u,s); log(DEBUG,"NetSendToAllExcept: '%s' '%s'",target,s); -- cgit v1.2.3