summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--doc/de/weechat_user.de.txt2
-rw-r--r--doc/en/weechat_user.en.txt1
-rw-r--r--doc/fr/weechat_user.fr.txt1
-rw-r--r--doc/it/weechat_user.it.txt2
-rw-r--r--src/plugins/irc/irc-command.c17
-rw-r--r--src/plugins/irc/irc-ctcp.c34
-rw-r--r--src/plugins/irc/irc-msgbuffer.c5
8 files changed, 53 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index b31c3c656..dafadff0f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
-v0.3.7-dev, 2012-01-24
+v0.3.7-dev, 2012-01-27
Version 0.3.7 (under dev!)
@@ -51,6 +51,7 @@ Version 0.3.7 (under dev!)
nicklist_get_next_item
* alias: add default alias umode => /mode $nick
* aspell: fix URL detection (do not check spelling of URLs) (bug #34040)
+* irc: add alias "ctcp" for target buffer of CTCP messages
* irc: add options irc.look.highlight_{server|channel|pv} to customize or
disable default nick highlight (task #11128)
* irc: use low priority for MODE sent automatically by WeeChat (when joining
diff --git a/doc/de/weechat_user.de.txt b/doc/de/weechat_user.de.txt
index 6c461455c..9133d8df4 100644
--- a/doc/de/weechat_user.de.txt
+++ b/doc/de/weechat_user.de.txt
@@ -1608,6 +1608,8 @@ Unvollständige Liste der IRC Nachrichten bzw. Alias die angepasst werden könne
| quit | | quit
| topic | | topic
| wallops | | wallops
+// TRANSLATION MISSING
+| | ctcp | ctcp (sent or received, in a privmsg or notice message)
| 221 | | User mode string
| 275 | whois | whois (sichere Verbindung)
| 301 | whois | whois (abwesend)
diff --git a/doc/en/weechat_user.en.txt b/doc/en/weechat_user.en.txt
index 062f63bd4..d86bb22b1 100644
--- a/doc/en/weechat_user.en.txt
+++ b/doc/en/weechat_user.en.txt
@@ -1587,6 +1587,7 @@ Non-comprehensive list of IRC messages or alias that you can customize:
| quit | | quit
| topic | | topic
| wallops | | wallops
+| | ctcp | ctcp (sent or received, in a privmsg or notice message)
| 221 | | user mode string
| 275 | whois | whois (secure connection)
| 301 | whois | whois (away)
diff --git a/doc/fr/weechat_user.fr.txt b/doc/fr/weechat_user.fr.txt
index 92e7e63e1..f70a8c5af 100644
--- a/doc/fr/weechat_user.fr.txt
+++ b/doc/fr/weechat_user.fr.txt
@@ -1636,6 +1636,7 @@ Liste non exhaustive des messages ou alias que vous pouvez paramétrer :
| quit | | quit
| topic | | topic
| wallops | | wallops
+| | ctcp | ctcp (envoyé ou reçu, dans un message privmsg ou notice)
| 221 | | chaîne de mode utilisateur
| 275 | whois | whois (connexion sécurisée)
| 301 | whois | whois (absent)
diff --git a/doc/it/weechat_user.it.txt b/doc/it/weechat_user.it.txt
index 90a51a709..30f0ee636 100644
--- a/doc/it/weechat_user.it.txt
+++ b/doc/it/weechat_user.it.txt
@@ -1626,6 +1626,8 @@ personalizzare:
| quit | | quit
| topic | | topic
| wallops | | wallops
+// TRANSLATION MISSING
+| | ctcp | ctcp (sent or received, in a privmsg or notice message)
| 221 | | stringa modalità utente
| 275 | whois | whois (connessione sicura)
| 301 | whois | whois (assente)
diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c
index fcf103cdd..852916059 100644
--- a/src/plugins/irc/irc-command.c
+++ b/src/plugins/irc/irc-command.c
@@ -42,6 +42,7 @@
#include "irc-display.h"
#include "irc-ignore.h"
#include "irc-input.h"
+#include "irc-msgbuffer.h"
#include "irc-nick.h"
#include "irc-notify.h"
#include "irc-protocol.h"
@@ -941,7 +942,10 @@ irc_command_ctcp (void *data, struct t_gui_buffer *buffer, int argc,
irc_server_sendf (ptr_server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL,
"PRIVMSG %s :\01PING %s\01",
argv[1], str_time);
- weechat_printf (ptr_server->buffer,
+ weechat_printf (irc_msgbuffer_get_target_buffer (ptr_server,
+ argv[1],
+ NULL, "ctcp",
+ NULL),
_("%sCTCP query to %s%s%s: %s%s%s%s%s"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_NICK,
@@ -961,7 +965,10 @@ irc_command_ctcp (void *data, struct t_gui_buffer *buffer, int argc,
irc_cmd,
(argv_eol[3]) ? " " : "",
(argv_eol[3]) ? argv_eol[3] : "");
- weechat_printf (ptr_server->buffer,
+ weechat_printf (irc_msgbuffer_get_target_buffer (ptr_server,
+ argv[1],
+ NULL, "ctcp",
+ NULL),
_("%sCTCP query to %s%s%s: %s%s%s%s%s"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_NICK,
@@ -2802,7 +2809,11 @@ irc_command_notice (void *data, struct t_gui_buffer *buffer, int argc,
break;
string = irc_color_decode (str_args,
weechat_config_boolean (irc_config_network_colors_receive));
- weechat_printf_tags ((ptr_channel) ? ptr_channel->buffer : ptr_server->buffer,
+ weechat_printf_tags (irc_msgbuffer_get_target_buffer (ptr_server,
+ argv[arg_target],
+ "notice",
+ NULL,
+ (ptr_channel) ? ptr_channel->buffer : NULL),
"notify_none,no_highlight",
"%s%s%s%s -> %s%s%s: %s",
weechat_prefix ("network"),
diff --git a/src/plugins/irc/irc-ctcp.c b/src/plugins/irc/irc-ctcp.c
index aa0aa4f46..f2fafdeae 100644
--- a/src/plugins/irc/irc-ctcp.c
+++ b/src/plugins/irc/irc-ctcp.c
@@ -34,6 +34,7 @@
#include "irc-channel.h"
#include "irc-color.h"
#include "irc-config.h"
+#include "irc-msgbuffer.h"
#include "irc-nick.h"
#include "irc-protocol.h"
#include "irc-server.h"
@@ -120,7 +121,9 @@ irc_ctcp_display_request (struct t_irc_server *server,
&& !weechat_config_boolean (irc_config_look_display_ctcp_blocked))
return;
- weechat_printf_tags ((channel) ? channel->buffer : server->buffer,
+ weechat_printf_tags (irc_msgbuffer_get_target_buffer (server, nick,
+ NULL, "ctcp",
+ (channel) ? channel->buffer : NULL),
irc_protocol_tags (command, "irc_ctcp", NULL),
_("%sCTCP requested by %s%s%s: %s%s%s%s%s%s"),
weechat_prefix ("network"),
@@ -178,8 +181,11 @@ irc_ctcp_display_reply_from_nick (struct t_irc_server *server,
difftime = ((sec2 * 1000000) + usec2) -
((sec1 * 1000000) + usec1);
-
- weechat_printf_tags (server->buffer,
+ weechat_printf_tags (irc_msgbuffer_get_target_buffer (server,
+ nick,
+ NULL,
+ "ctcp",
+ NULL),
irc_protocol_tags (command,
"irc_ctcp",
NULL),
@@ -202,7 +208,11 @@ irc_ctcp_display_reply_from_nick (struct t_irc_server *server,
}
else
{
- weechat_printf_tags (server->buffer,
+ weechat_printf_tags (irc_msgbuffer_get_target_buffer (server,
+ nick,
+ NULL,
+ "ctcp",
+ NULL),
irc_protocol_tags (command,
"irc_ctcp",
NULL),
@@ -221,7 +231,9 @@ irc_ctcp_display_reply_from_nick (struct t_irc_server *server,
}
else
{
- weechat_printf_tags (server->buffer,
+ weechat_printf_tags (irc_msgbuffer_get_target_buffer (server, nick,
+ NULL, "ctcp",
+ NULL),
irc_protocol_tags (command, NULL, NULL),
_("%sCTCP reply from %s%s%s: %s%s%s%s%s"),
weechat_prefix ("network"),
@@ -277,7 +289,11 @@ irc_ctcp_reply_to_nick (struct t_irc_server *server,
str_args = weechat_hashtable_get (hashtable, hash_key);
if (!str_args)
break;
- weechat_printf_tags ((channel) ? channel->buffer : server->buffer,
+ weechat_printf_tags (irc_msgbuffer_get_target_buffer (server,
+ nick,
+ NULL,
+ "ctcp",
+ (channel) ? channel->buffer : NULL),
irc_protocol_tags (command,
"irc_ctcp,irc_ctcp_reply,"
"notify_none,no_highlight",
@@ -1010,7 +1026,11 @@ irc_ctcp_recv (struct t_irc_server *server, const char *command,
{
if (weechat_config_boolean (irc_config_look_display_ctcp_unknown))
{
- weechat_printf_tags ((channel) ? channel->buffer : server->buffer,
+ weechat_printf_tags (irc_msgbuffer_get_target_buffer (server,
+ nick,
+ NULL,
+ "ctcp",
+ (channel) ? channel->buffer : NULL),
irc_protocol_tags (command,
"irc_ctcp",
NULL),
diff --git a/src/plugins/irc/irc-msgbuffer.c b/src/plugins/irc/irc-msgbuffer.c
index c788ec4a6..9a0fe2765 100644
--- a/src/plugins/irc/irc-msgbuffer.c
+++ b/src/plugins/irc/irc-msgbuffer.c
@@ -93,7 +93,10 @@ irc_msgbuffer_get_target_buffer (struct t_irc_server *server, const char *nick,
struct t_irc_channel *ptr_channel;
struct t_weechat_plugin *buffer_plugin;
- ptr_option = irc_msgbuffer_get_option (server, message);
+ ptr_option = NULL;
+
+ if (message && message[0])
+ ptr_option = irc_msgbuffer_get_option (server, message);
if (!ptr_option && alias && alias[0])
ptr_option = irc_msgbuffer_get_option (server, alias);