summaryrefslogtreecommitdiff
path: root/src/plugins/irc/irc-protocol.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2009-06-14 18:50:43 +0200
committerSebastien Helleu <flashcode@flashtux.org>2009-06-14 18:50:43 +0200
commit7d302429d2ee90f4c95cbc48f5b40802513150b4 (patch)
treea24ac572c1def80321087c59ed358b7110a3ebe9 /src/plugins/irc/irc-protocol.c
parentbf2b06bb032dbdd43f7839591325d36d24fa6150 (diff)
downloadweechat-7d302429d2ee90f4c95cbc48f5b40802513150b4.zip
Improve option irc.look.notice_as_pv, new values: auto/never/always
This allows private chat with following nicks: nickserv/chanserv/memoserv.
Diffstat (limited to 'src/plugins/irc/irc-protocol.c')
-rw-r--r--src/plugins/irc/irc-protocol.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index c235223ad..b6d8e2737 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -856,10 +856,12 @@ irc_protocol_cmd_notice (struct t_irc_server *server, const char *command,
notify_private = 1;
}
- if (nick && weechat_config_boolean (irc_config_look_notice_as_pv))
+ ptr_channel = NULL;
+ if (nick && weechat_config_integer (irc_config_look_notice_as_pv) != IRC_CONFIG_LOOK_NOTICE_AS_PV_NEVER)
{
ptr_channel = irc_channel_search (server, nick);
- if (!ptr_channel)
+ if (!ptr_channel
+ && weechat_config_integer (irc_config_look_notice_as_pv) == IRC_CONFIG_LOOK_NOTICE_AS_PV_ALWAYS)
{
ptr_channel = irc_channel_new (server,
IRC_CHANNEL_TYPE_PRIVATE,
@@ -871,15 +873,18 @@ irc_protocol_cmd_notice (struct t_irc_server *server, const char *command,
"private buffer \"%s\""),
weechat_prefix ("error"),
IRC_PLUGIN_NAME, nick);
- return WEECHAT_RC_ERROR;
}
}
+ }
+
+ if (ptr_channel)
+ {
if (!ptr_channel->topic)
irc_channel_set_topic (ptr_channel, address);
weechat_printf_tags (ptr_channel->buffer,
irc_protocol_tags (command,
- (notify_private) ? "notify_private" : NULL),
+ "notify_private"),
"%s%s",
irc_nick_as_prefix (NULL, nick,
IRC_COLOR_CHAT_NICK_OTHER),