summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2012-05-02 12:42:44 +0200
committerSebastien Helleu <flashcode@flashtux.org>2012-05-02 12:42:44 +0200
commit0b73835e8ad290c8d5545e540f7745af2a959c15 (patch)
tree191c9c4940b510ffc2931752d444dc6720a9efdf /src
parentc01aaf9335073088c744084e95edbe1a7e78d0f1 (diff)
downloadweechat-0b73835e8ad290c8d5545e540f7745af2a959c15.zip
irc: hide everything after "identify" or "register" in messages to nickserv when option irc.look.hide_nickserv_pwd is on (bug #36362)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/irc/irc-display.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/src/plugins/irc/irc-display.c b/src/plugins/irc/irc-display.c
index fede0722c..223a629b6 100644
--- a/src/plugins/irc/irc-display.c
+++ b/src/plugins/irc/irc-display.c
@@ -44,7 +44,7 @@
void
irc_display_hide_password (char *string, int look_for_nickserv)
{
- char *pos_nickserv, *pos, *pos_pwd, *pos_space;
+ char *pos_nickserv, *pos, *pos_pwd;
int char_size;
pos = string;
@@ -61,18 +61,7 @@ irc_display_hide_password (char *string, int look_for_nickserv)
pos++;
}
if (strncmp (pos, "identify ", 9) == 0)
- {
pos_pwd = pos + 9;
- pos_space = strchr (pos_pwd, ' ');
- if (pos_space)
- {
- pos_pwd = pos_space + 1;
- while (pos_pwd[0] == ' ')
- {
- pos_pwd++;
- }
- }
- }
else if (strncmp (pos, "register ", 9) == 0)
pos_pwd = pos + 9;
else
@@ -82,18 +71,7 @@ irc_display_hide_password (char *string, int look_for_nickserv)
{
pos_pwd = strstr (pos, "identify ");
if (pos_pwd)
- {
pos_pwd += 9;
- pos_space = strchr (pos_pwd, ' ');
- if (pos_space)
- {
- pos_pwd = pos_space + 1;
- while (pos_pwd[0] == ' ')
- {
- pos_pwd++;
- }
- }
- }
else
{
pos_pwd = strstr (pos, "register ");
@@ -111,7 +89,7 @@ irc_display_hide_password (char *string, int look_for_nickserv)
pos_pwd++;
}
- while (pos_pwd && pos_pwd[0] && (pos_pwd[0] != ' '))
+ while (pos_pwd && pos_pwd[0])
{
char_size = weechat_utf8_char_size (pos_pwd);
if (char_size > 0)