nickserv passwords hidden (new config option: log_hide_nickserv_pwd on/off)
This commit is contained in:
parent
cb5269404c
commit
482d327562
@ -5,6 +5,7 @@ ChangeLog - 2004-10-17
|
||||
|
||||
|
||||
Version 0.0.8 (under dev!):
|
||||
* nickserv passwords hidden (new config option: log_hide_nickserv_pwd on/off)
|
||||
* auto-rejoin channels when kicked (new config option: server_autorejoin on/off)
|
||||
* added IRC::command function for Perl scripts
|
||||
* fixed bug when adding alias with same name as other
|
||||
|
@ -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;
|
||||
|
@ -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 }
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
|
@ -513,6 +513,7 @@ int
|
||||
irc_cmd_send_msg (t_irc_server *server, char *arguments)
|
||||
{
|
||||
char *pos, *pos_comma;
|
||||
char *msg_pwd_hidden, *pos_pwd;
|
||||
t_irc_channel *ptr_channel;
|
||||
t_irc_nick *ptr_nick;
|
||||
|
||||
@ -582,6 +583,41 @@ irc_cmd_send_msg (t_irc_server *server, char *arguments)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* message to nickserv with identify ? */
|
||||
if (strcmp (arguments, "nickserv") == 0)
|
||||
{
|
||||
msg_pwd_hidden = strdup (pos);
|
||||
if (cfg_log_hide_nickserv_pwd)
|
||||
{
|
||||
pos_pwd = strstr (msg_pwd_hidden, "identify ");
|
||||
if (!pos_pwd)
|
||||
pos_pwd = strstr (msg_pwd_hidden, "register ");
|
||||
if (pos_pwd)
|
||||
{
|
||||
pos_pwd += 9;
|
||||
while (pos_pwd[0])
|
||||
{
|
||||
pos_pwd[0] = '*';
|
||||
pos_pwd++;
|
||||
}
|
||||
}
|
||||
}
|
||||
gui_printf_color_type (server->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "-");
|
||||
gui_printf_color_type (server->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_NICK, "%s", arguments);
|
||||
gui_printf_color_type (server->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "-");
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT, " %s\n", msg_pwd_hidden);
|
||||
server_sendf (server, "PRIVMSG %s :%s\r\n", arguments, pos);
|
||||
free (msg_pwd_hidden);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ptr_channel = channel_search (server, arguments);
|
||||
if (!ptr_channel)
|
||||
{
|
||||
|
@ -5,6 +5,7 @@ ChangeLog - 2004-10-17
|
||||
|
||||
|
||||
Version 0.0.8 (under dev!):
|
||||
* nickserv passwords hidden (new config option: log_hide_nickserv_pwd on/off)
|
||||
* auto-rejoin channels when kicked (new config option: server_autorejoin on/off)
|
||||
* added IRC::command function for Perl scripts
|
||||
* fixed bug when adding alias with same name as other
|
||||
|
@ -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;
|
||||
|
@ -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 }
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
|
@ -513,6 +513,7 @@ int
|
||||
irc_cmd_send_msg (t_irc_server *server, char *arguments)
|
||||
{
|
||||
char *pos, *pos_comma;
|
||||
char *msg_pwd_hidden, *pos_pwd;
|
||||
t_irc_channel *ptr_channel;
|
||||
t_irc_nick *ptr_nick;
|
||||
|
||||
@ -582,6 +583,41 @@ irc_cmd_send_msg (t_irc_server *server, char *arguments)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* message to nickserv with identify ? */
|
||||
if (strcmp (arguments, "nickserv") == 0)
|
||||
{
|
||||
msg_pwd_hidden = strdup (pos);
|
||||
if (cfg_log_hide_nickserv_pwd)
|
||||
{
|
||||
pos_pwd = strstr (msg_pwd_hidden, "identify ");
|
||||
if (!pos_pwd)
|
||||
pos_pwd = strstr (msg_pwd_hidden, "register ");
|
||||
if (pos_pwd)
|
||||
{
|
||||
pos_pwd += 9;
|
||||
while (pos_pwd[0])
|
||||
{
|
||||
pos_pwd[0] = '*';
|
||||
pos_pwd++;
|
||||
}
|
||||
}
|
||||
}
|
||||
gui_printf_color_type (server->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "-");
|
||||
gui_printf_color_type (server->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_NICK, "%s", arguments);
|
||||
gui_printf_color_type (server->buffer,
|
||||
MSG_TYPE_NICK,
|
||||
COLOR_WIN_CHAT_DARK, "-");
|
||||
gui_printf_color (server->buffer,
|
||||
COLOR_WIN_CHAT, " %s\n", msg_pwd_hidden);
|
||||
server_sendf (server, "PRIVMSG %s :%s\r\n", arguments, pos);
|
||||
free (msg_pwd_hidden);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ptr_channel = channel_search (server, arguments);
|
||||
if (!ptr_channel)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user