summaryrefslogtreecommitdiff
path: root/src/irc/irc-recv.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2006-01-21 11:56:58 +0000
committerSebastien Helleu <flashcode@flashtux.org>2006-01-21 11:56:58 +0000
commit5aeb7921fee0a79e49e0b9d0d0bd4bce2c674a90 (patch)
treef3f3efaa2ce239ee18f65b4bc5aaf4695f0c3ee7 /src/irc/irc-recv.c
parente907b3b7a5dc3ad95741142d7477c3868da78c47 (diff)
downloadweechat-5aeb7921fee0a79e49e0b9d0d0bd4bce2c674a90.zip
Added option "irc_show_away_once", to show away message only once in pv
Diffstat (limited to 'src/irc/irc-recv.c')
-rw-r--r--src/irc/irc-recv.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/irc/irc-recv.c b/src/irc/irc-recv.c
index f521d581e..f7d52b2cc 100644
--- a/src/irc/irc-recv.c
+++ b/src/irc/irc-recv.c
@@ -2564,14 +2564,25 @@ irc_cmd_recv_301 (t_irc_server *server, char *host, char *nick, char *arguments)
{
/* look for private buffer to display message */
ptr_channel = channel_search (server, pos_nick);
- ptr_buffer = (ptr_channel) ? ptr_channel->buffer : server->buffer;
- irc_display_prefix (server, ptr_buffer, PREFIX_INFO);
- gui_printf (ptr_buffer,
- _("%s%s%s is away: %s\n"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
- pos_nick,
- GUI_COLOR(COLOR_WIN_CHAT),
- pos_message);
+ if (!cfg_irc_show_away_once || !ptr_channel ||
+ !(ptr_channel->away_message) ||
+ (strcmp (ptr_channel->away_message, pos_message) != 0))
+ {
+ ptr_buffer = (ptr_channel) ? ptr_channel->buffer : server->buffer;
+ irc_display_prefix (server, ptr_buffer, PREFIX_INFO);
+ gui_printf (ptr_buffer,
+ _("%s%s%s is away: %s\n"),
+ GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ pos_nick,
+ GUI_COLOR(COLOR_WIN_CHAT),
+ pos_message);
+ if (ptr_channel)
+ {
+ if (ptr_channel->away_message)
+ free (ptr_channel->away_message);
+ ptr_channel->away_message = strdup (pos_message);
+ }
+ }
}
}
}