summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-25 14:49:25 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-25 14:49:25 +0000
commit1164ae11b22509889203fbcbe114f67191deeed4 (patch)
tree25437523e8117ad058c2b62ddd920f1449f58a4a
parentd70ae11ab22d10e40cae525ff28022e596a7c6f0 (diff)
Fixed to never append double sums
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1513 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/helperfuncs.cpp42
1 files 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);