X-Git-Url: https://jfr.im/git/irc/gameservirc.git/blobdiff_plain/69fb5a933479d9fd985370e7fb381465bfefa99c..9bafc40df91539963591e7f114012c2f5635e7e3:/gameserv/gameserv.cpp diff --git a/gameserv/gameserv.cpp b/gameserv/gameserv.cpp index 6a68086..923cd5a 100644 --- a/gameserv/gameserv.cpp +++ b/gameserv/gameserv.cpp @@ -463,6 +463,22 @@ void notice(const char *source, const char *dest, const char *fmt, ...) if (fmt[0] == '\0') return; + char *commanduse; + commanduse = new char[16]; + + #ifdef P10 + if (isUsePrivmsg(configflags)) + strncpy(commanduse, "P", 1); + else + strncpy(commanduse, "N", 1); + #else + + if (isUsePrivmsg(configflags)) + strncpy(commanduse, "PRIVMSG", 7); + else + strncpy(commanduse, "NOTICE", 6); + #endif + va_list args; char *input; const char *t = fmt; @@ -473,9 +489,9 @@ void notice(const char *source, const char *dest, const char *fmt, ...) dest++; #if !defined(P10) - sprintf(input, ":%s NOTICE %s :", source, dest); + sprintf(input, ":%s %s %s :", source, commanduse, dest); #else - sprintf(input, "%s O %s :", gsnum, dest); + sprintf(input, "%s %s %s :", gsnum, commanduse, dest); #endif dest--; @@ -483,9 +499,9 @@ void notice(const char *source, const char *dest, const char *fmt, ...) else { #if !defined(P10) - sprintf(input, ":%s NOTICE %s :", source, dest); + sprintf(input, ":%s %s %s :", source, commanduse, dest); #else - sprintf(input, "%s O %s :", gsnum, dest); + sprintf(input, "%s %s %s :", gsnum, commanduse, dest); #endif } @@ -513,6 +529,7 @@ void notice(const char *source, const char *dest, const char *fmt, ...) #endif sprintf(input, "%s%s", input, "\r\n"); sock_puts(sock, input); + delete [] commanduse; delete [] input; va_end(args); }