1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-03 16:23:14 +02:00

nickserv passwords hidden (new config option: log_hide_nickserv_pwd on/off)

This commit is contained in:
Sebastien Helleu
2004-10-17 11:28:03 +00:00
parent cb5269404c
commit 482d327562
10 changed files with 146 additions and 0 deletions
+30
View File
@@ -39,6 +39,32 @@ t_history *history_general_ptr = NULL;
int num_history_general = 0;
/*
* history_hide_password: hide a nickserv password
*/
void
history_hide_password (char *string)
{
char *pos_pwd;
if (strstr (string, "nickserv "))
{
pos_pwd = strstr (string, "identify ");
if (!pos_pwd)
pos_pwd = strstr (string, "register ");
if (pos_pwd)
{
pos_pwd += 9;
while (pos_pwd[0])
{
pos_pwd[0] = '*';
pos_pwd++;
}
}
}
}
/*
* history_add: add a text/command to history
*/
@@ -53,6 +79,8 @@ history_add (void *buffer, char *string)
if (new_history)
{
new_history->text = strdup (string);
if (cfg_log_hide_nickserv_pwd)
history_hide_password (new_history->text);
if (history_general)
history_general->prev_history = new_history;
@@ -82,6 +110,8 @@ history_add (void *buffer, char *string)
if (new_history)
{
new_history->text = strdup (string);
if (cfg_log_hide_nickserv_pwd)
history_hide_password (new_history->text);
if (((t_gui_buffer *)(buffer))->history)
((t_gui_buffer *)(buffer))->history->prev_history = new_history;
+5
View File
@@ -417,6 +417,7 @@ int cfg_log_auto_channel;
int cfg_log_auto_private;
char *cfg_log_path;
char *cfg_log_timestamp;
int cfg_log_hide_nickserv_pwd;
t_config_option weechat_options_log[] =
{ { "log_auto_server", N_("automatically log server messages"),
@@ -439,6 +440,10 @@ t_config_option weechat_options_log[] =
N_("timestamp for log (see man strftime for date/time specifiers)"),
OPTION_TYPE_STRING, 0, 0, 0,
"%Y %b %d %H:%M:%S", NULL, NULL, &cfg_log_timestamp, NULL },
{ "log_hide_nickserv_pwd", N_("hide password displayed by nickserv"),
N_("hide password displayed by nickserv"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_log_hide_nickserv_pwd, NULL, NULL },
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
};
+1
View File
@@ -144,6 +144,7 @@ extern int cfg_log_auto_channel;
extern int cfg_log_auto_private;
extern char *cfg_log_path;
extern char *cfg_log_timestamp;
extern int cfg_log_hide_nickserv_pwd;
extern int cfg_dcc_auto_accept_files;
extern int cfg_dcc_auto_accept_chats;