From 72ee3e62976a258f763b0ba34ceeecde9a59b2ab Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Tue, 27 Jun 2017 16:27:59 +1000 Subject: [PATCH] Correct order of arguments to /FSET SEND_ENCRYPTED_MSG and SEND_ENCRYPTED_NOTICE and improve default formatting The argument order and default format now mirrors SEND_MSG / SEND_NOTICE but with different colours. --- Changelog | 3 +++ include/color.h | 8 ++++---- source/commands.c | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Changelog b/Changelog index 8d19acf..5e05dfb 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,8 @@ [Changes 1.2.2] +* Correct order of arguments to /FSET SEND_ENCRYPTED_MSG and + SEND_ENCRYPTED_NOTICE and improve default formatting. (caf) + * Add /FSET ENCRYPTED_PUBLIC and ENCRYPTED_PUBLIC_NOTICE formats, and fix use of ENCRYPTED_PRIVMSG and ENCRYPTED_NOTICE so they use the right number of arguments. (caf) diff --git a/include/color.h b/include/color.h index 409e3a4..28ab80d 100644 --- a/include/color.h +++ b/include/color.h @@ -217,8 +217,8 @@ #define DEFAULT_FORMAT_SEND_AWAY_FSET "[Away ($strftime($1 %a %b %d %I:%M%p %Z))] [$tdiff2(${time() - u})] [BX-MsgLog $2]" #define DEFAULT_FORMAT_SEND_CTCP_FSET "%K[%rctcp%K(%R$1%K)] %n$2" #define DEFAULT_FORMAT_SEND_RCTCP_FSET "%K[%rrctcp%K(%R$1%K)] %n$2-" -#define DEFAULT_FORMAT_SEND_ENCRYPTED_NOTICE_FSET "%K-%Y$1%K(%p$2%K)-%n $2-" -#define DEFAULT_FORMAT_SEND_ENCRYPTED_MSG_FSET "%K[%Y$1%K(%p$2%K)]%n $2-" +#define DEFAULT_FORMAT_SEND_ENCRYPTED_NOTICE_FSET "%K[%ynotice%K(%Y$1%K)] %n$3-" +#define DEFAULT_FORMAT_SEND_ENCRYPTED_MSG_FSET "%K[%ymsg%K(%Y$1%K)] %n$3-" #define DEFAULT_FORMAT_SERVER_FSET "$G%n $1: $2-" @@ -642,8 +642,8 @@ #define DEFAULT_FORMAT_SEND_CTCP_FSET ansi?"%K[%rctcp%K(%R$1%K)] %n$2":"[ctcp($1)] $2" #define DEFAULT_FORMAT_SEND_RCTCP_FSET ansi?"%K[%rrctcp%K(%R$1%K)] %n$2-":"^B[rctcp(^B$1^B)]^B $2-" #define DEFAULT_FORMAT_SEND_DCC_CHAT_FSET ansi?"%K[%rdcc%K(%R$1%K)] %n$2-":"[dcc($1)] $2-" -#define DEFAULT_FORMAT_SEND_ENCRYPTED_NOTICE_FSET "%K-%Y$1%K(%p$2%K)-%n $2-" -#define DEFAULT_FORMAT_SEND_ENCRYPTED_MSG_FSET "%K[%Y$1%K(%p$2%K)]%n $2-" +#define DEFAULT_FORMAT_SEND_ENCRYPTED_NOTICE_FSET "%K[%ynotice%K(%Y$1%K)] %n$3-" +#define DEFAULT_FORMAT_SEND_ENCRYPTED_MSG_FSET "%K[%ymsg%K(%Y$1%K)] %n$3-" #define DEFAULT_FORMAT_SEND_MSG_FSET ansi?"%K[%rmsg%K(%R$1%K)] %n$3-":"[msg($1)] $3-" #define DEFAULT_FORMAT_SEND_NOTICE_FSET ansi?"%K[%rnotice%K(%R$1%K)] %n$3-":"[notice($1)] $3-" diff --git a/source/commands.c b/source/commands.c index 8d3557f..449fbdc 100644 --- a/source/commands.c +++ b/source/commands.c @@ -3917,7 +3917,7 @@ struct target_type target[4] = line = crypt_msg(copy, key); if (hook && do_hook(target[i].hook_type, "%s %s", current_nick, copy)) put_it("%s", convert_output_format(fget_string_var(target[i].hook_type == SEND_MSG_LIST?FORMAT_SEND_ENCRYPTED_MSG_FSET:FORMAT_SEND_ENCRYPTED_NOTICE_FSET), - "%s %s %s %s",update_clock(GET_TIME), get_server_nickname(from_server),current_nick, text)); + "%s %s %s %s",update_clock(GET_TIME), current_nick, get_server_nickname(from_server), text)); send_to_server("%s %s :%s", target[i].command, current_nick, line); new_free(&line);