From 43d482a444fd880716d643285ec8f6d92774a89e Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Tue, 10 May 2016 18:30:55 +1000 Subject: [PATCH] Change /FSETs SERVER_NOTICE_KLINE and SERVER_NOTICE_GLINE to show the ban type The ban type (eg. K-Line, G-Line, D-Line etc.) is now passed in the second-last argument of these formats. --- Changelog | 3 +++ include/color.h | 8 ++++---- source/notice.c | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Changelog b/Changelog index 8eda5c4..eb39ec1 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,8 @@ [Changes 1.2.2] +* Change formatting of /FSETs SERVER_NOTICE_KLINE and SERVER_NOTICE_GLINE + to show the ban type. (caf) + * Clean up handling of oper server notices, including removing some obsolete notice types (eg "high-traffic mode"). (caf) diff --git a/include/color.h b/include/color.h index 637a02d..bbe8918 100644 --- a/include/color.h +++ b/include/color.h @@ -237,8 +237,8 @@ #define DEFAULT_FORMAT_SERVER_NOTICE_FAKE_FSET "Fake Mode detected on $1 -> $2-" #define DEFAULT_FORMAT_SERVER_NOTICE_KILL_FSET "Foreign OperKill: %W$1%n killed %c$2%n %K(%n$3-%K)%n" #define DEFAULT_FORMAT_SERVER_NOTICE_KILL_LOCAL_FSET "Local OperKill: %W$1%n killed %c$2%n %K(%n$3-%K)%n" -#define DEFAULT_FORMAT_SERVER_NOTICE_KLINE_FSET "%W$1%n added a new K-Line %K[%c$2%K]%n for $3-" -#define DEFAULT_FORMAT_SERVER_NOTICE_GLINE_FSET "%W$1%n added a new K-Line %K[%c$2%K]%n from $3 for $4-" +#define DEFAULT_FORMAT_SERVER_NOTICE_KLINE_FSET "%W$1%n added a new $3 %K[%c$2%K]%n for %K[%R$4-%K]" +#define DEFAULT_FORMAT_SERVER_NOTICE_GLINE_FSET "%W$1%n added a new $4 %K[%c$2%K]%n from %W$3%n for %K[%R$4-%K]" #define DEFAULT_FORMAT_SERVER_NOTICE_NICK_COLLISION_FSET "Nick collision %W$1%n killed %c$2-%n" #define DEFAULT_FORMAT_SERVER_NOTICE_OPER_FSET "%C$1 %K[%c$2%K]%n is now %Wan%w %GIRC%n whore" #define DEFAULT_FORMAT_SERVER_NOTICE_REHASH_FSET "%W$1%n is rehashing the Server config file" @@ -665,8 +665,8 @@ #define DEFAULT_FORMAT_SERVER_NOTICE_FAKE_FSET "Fake Mode detected on $1 -> $2-" #define DEFAULT_FORMAT_SERVER_NOTICE_KILL_FSET "Foreign OperKill: %W$1%n killed %c$2%n %K(%n$3-%K)%n" #define DEFAULT_FORMAT_SERVER_NOTICE_KILL_LOCAL_FSET "Local OperKill: %W$1%n killed %c$2%n %K(%n$3-%K)%n" -#define DEFAULT_FORMAT_SERVER_NOTICE_KLINE_FSET "%W$1%n added a new K-Line %K[%c$2%K]%n for $3-" -#define DEFAULT_FORMAT_SERVER_NOTICE_GLINE_FSET "%W$1%n added a new K-Line %K[%c$2%K]%n from $3 for $4-" +#define DEFAULT_FORMAT_SERVER_NOTICE_KLINE_FSET "%W$1%n added a new $3 %K[%c$2%K]%n for %K[%R$4-%K]" +#define DEFAULT_FORMAT_SERVER_NOTICE_GLINE_FSET "%W$1%n added a new $4 %K[%c$2%K]%n from %W$3%n for %K[%R$4-%K]" #define DEFAULT_FORMAT_SERVER_NOTICE_NICK_COLLISION_FSET "Nick collision %W$1%n killed %c$2-%n" #define DEFAULT_FORMAT_SERVER_NOTICE_OPER_FSET "%C$1 %K[%c$2%K]%n is now %Wan%w %GIRC%n whore" #define DEFAULT_FORMAT_SERVER_NOTICE_REHASH_FSET "%W$1%n is rehashing the Server config file" diff --git a/source/notice.c b/source/notice.c index 3a5c14d..b744d52 100644 --- a/source/notice.c +++ b/source/notice.c @@ -208,10 +208,10 @@ static void handle_oper_vision(const char *from, const char *line) if (sscanf(arg[0], "%100[^!]!%*[^@]@%*[^{]{%100s", oper, serv) == 2 && strchr(serv, '.')) { chop(serv, 1); - serversay(from, "%s", convert_output_format(fget_string_var(FORMAT_SERVER_NOTICE_GLINE_FSET), "%s %s %s %s [%s]", update_clock(GET_TIME), oper, arg[2], serv, arg[3])); + serversay(from, "%s", convert_output_format(fget_string_var(FORMAT_SERVER_NOTICE_GLINE_FSET), "%s %s %s %s %s %s", update_clock(GET_TIME), oper, arg[2], serv, arg[1], arg[3])); } else - serversay(from, "%s", convert_output_format(fget_string_var(FORMAT_SERVER_NOTICE_KLINE_FSET), "%s %s %s [%s]", update_clock(GET_TIME), arg[0], arg[2], arg[3])); + serversay(from, "%s", convert_output_format(fget_string_var(FORMAT_SERVER_NOTICE_KLINE_FSET), "%s %s %s %s %s", update_clock(GET_TIME), arg[0], arg[2], arg[1], arg[3])); } /* "User %s (%s@%s) trying to join %s is a possible spambot" * "User %s (%s@%s) is a possible spambot"