1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 05:46:38 +02:00

irc: add alias "ctcp" for target buffer of CTCP messages

This commit is contained in:
Sebastien Helleu
2012-01-27 18:18:35 +01:00
parent f8a25b4299
commit b6a7777aa0
8 changed files with 53 additions and 12 deletions
+2 -1
View File
@@ -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
+2
View File
@@ -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)
+1
View File
@@ -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)
+1
View File
@@ -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)
+2
View File
@@ -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)
+14 -3
View File
@@ -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"),
+27 -7
View File
@@ -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),
+4 -1
View File
@@ -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);