diff --git a/Changelog b/Changelog index 5e05dfb..ac9d7b1 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,7 @@ [Changes 1.2.2] +* Add /FSET SEND_ENCRYPTED_PUBLIC format. (caf) + * Correct order of arguments to /FSET SEND_ENCRYPTED_MSG and SEND_ENCRYPTED_NOTICE and improve default formatting. (caf) diff --git a/include/color.h b/include/color.h index 28ab80d..d92dc23 100644 --- a/include/color.h +++ b/include/color.h @@ -217,8 +217,9 @@ #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[%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_ENCRYPTED_NOTICE_FSET "%K[%ynotice%K(%Y$1%K)] %n$3-" +#define DEFAULT_FORMAT_SEND_ENCRYPTED_PUBLIC_FSET "%y<%n$2%K:%n$1%y>%n $3-" #define DEFAULT_FORMAT_SERVER_FSET "$G%n $1: $2-" @@ -642,8 +643,9 @@ #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[%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_ENCRYPTED_NOTICE_FSET "%K[%ynotice%K(%Y$1%K)] %n$3-" +#define DEFAULT_FORMAT_SEND_ENCRYPTED_PUBLIC_FSET "%y<%n$2%K:%n$1%y>%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/include/cset.h b/include/cset.h index 05cdcbe..71d1b94 100644 --- a/include/cset.h +++ b/include/cset.h @@ -290,6 +290,7 @@ FORMAT_SEND_CTCP_FSET, FORMAT_SEND_DCC_CHAT_FSET, FORMAT_SEND_ENCRYPTED_MSG_FSET, FORMAT_SEND_ENCRYPTED_NOTICE_FSET, +FORMAT_SEND_ENCRYPTED_PUBLIC_FSET, FORMAT_SEND_MSG_FSET, FORMAT_SEND_NOTICE_FSET, diff --git a/source/commands.c b/source/commands.c index 449fbdc..fbd4b30 100644 --- a/source/commands.c +++ b/source/commands.c @@ -3763,8 +3763,9 @@ struct target_type char *command; char *format; unsigned long level; - char *output; - char *other_output; + const char *output; + const char *other_output; + const char *format_encrypted; }; int current_target = 0; @@ -3811,11 +3812,15 @@ struct target_type target[4] = target[0].output = fget_string_var(FORMAT_SEND_MSG_FSET); + target[0].format_encrypted = fget_string_var(FORMAT_SEND_ENCRYPTED_MSG_FSET); target[1].output = fget_string_var(FORMAT_SEND_PUBLIC_FSET); target[1].other_output = fget_string_var(FORMAT_SEND_PUBLIC_OTHER_FSET); + target[1].format_encrypted = fget_string_var(FORMAT_SEND_ENCRYPTED_PUBLIC_FSET); target[2].output = fget_string_var(FORMAT_SEND_NOTICE_FSET); + target[2].format_encrypted = fget_string_var(FORMAT_SEND_ENCRYPTED_NOTICE_FSET); target[3].output = fget_string_var(FORMAT_SEND_NOTICE_FSET); target[3].other_output = fget_string_var(FORMAT_SEND_NOTICE_FSET); + target[3].format_encrypted = fget_string_var(FORMAT_SEND_ENCRYPTED_NOTICE_FSET); if (sent_text_recursion) hook = 0; @@ -3916,8 +3921,8 @@ 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), current_nick, get_server_nickname(from_server), text)); + put_it("%s", convert_output_format(target[i].format_encrypted, + "%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); diff --git a/source/fset.c b/source/fset.c index eb7b528..120cb21 100644 --- a/source/fset.c +++ b/source/fset.c @@ -172,7 +172,8 @@ IrcVariable fset_array[] = { "SEND_CTCP", 0,STR_TYPE_VAR, 0, NULL, NULL, 0, 0}, { "SEND_DCC_CHAT", 0,STR_TYPE_VAR, 0, NULL, NULL, 0, 0}, { "SEND_ENCRYPTED_MSG", 0,STR_TYPE_VAR, 0, NULL, NULL, 0, 0}, - { "SEND_ENCRYPTED_NOTICE",0,STR_TYPE_VAR,0, NULL, NULL, 0, 0}, + { "SEND_ENCRYPTED_NOTICE", 0,STR_TYPE_VAR,0, NULL, NULL, 0, 0}, + { "SEND_ENCRYPTED_PUBLIC", 0,STR_TYPE_VAR,0, NULL, NULL, 0, 0}, { "SEND_MSG", 0,STR_TYPE_VAR, 0, NULL, NULL, 0, 0}, { "SEND_NOTICE", 0,STR_TYPE_VAR, 0, NULL, NULL, 0, 0}, { "SEND_PUBLIC", 0,STR_TYPE_VAR, 0, NULL, NULL, 0, 0}, @@ -679,8 +680,9 @@ void create_fsets(Window *win, int ansi) fset_string_var(FORMAT_SEND_AWAY_FSET, DEFAULT_FORMAT_SEND_AWAY_FSET); fset_string_var(FORMAT_SEND_CTCP_FSET, DEFAULT_FORMAT_SEND_CTCP_FSET); fset_string_var(FORMAT_SEND_DCC_CHAT_FSET, DEFAULT_FORMAT_SEND_DCC_CHAT_FSET); - fset_string_var(FORMAT_SEND_ENCRYPTED_NOTICE_FSET, DEFAULT_FORMAT_SEND_ENCRYPTED_NOTICE_FSET); fset_string_var(FORMAT_SEND_ENCRYPTED_MSG_FSET, DEFAULT_FORMAT_SEND_ENCRYPTED_MSG_FSET); + fset_string_var(FORMAT_SEND_ENCRYPTED_NOTICE_FSET, DEFAULT_FORMAT_SEND_ENCRYPTED_NOTICE_FSET); + fset_string_var(FORMAT_SEND_ENCRYPTED_PUBLIC_FSET, DEFAULT_FORMAT_SEND_ENCRYPTED_PUBLIC_FSET); fset_string_var(FORMAT_SEND_MSG_FSET, DEFAULT_FORMAT_SEND_MSG_FSET); fset_string_var(FORMAT_SEND_NOTICE_FSET, DEFAULT_FORMAT_SEND_NOTICE_FSET);