irc: add modifier "irc_in2_xxx" (called after charset decoding)

v2.8-utf8proc
Sebastien Helleu 2011-04-26 18:19:27 +02:00
parent 3fd2af8184
commit f002c8e7de
5 changed files with 65 additions and 25 deletions

View File

@ -63,6 +63,7 @@ Version 0.3.5 (under dev!)
(plugins: irc, relay, xfer, scripts)
* aspell: add section "option" in aspell.conf for speller options (task #11083)
* aspell: fix spellers used after switch of window (bug #32811)
* irc: add modifier "irc_in2_xxx" (called after charset decoding)
* irc: fix memory leak when copying or renaming server
* irc: do not rejoin channels where /part has been issued before reconnection
to server (bug #33029)

View File

@ -7710,7 +7710,12 @@ Arguments:
| irc | irc_in_xxx ^(1)^ |
server name |
content of message received from IRC server |
content of message received from IRC server (before charset decoding) |
new content of message
| irc | irc_in2_xxx ^(1)^ |
server name |
content of message received from IRC server (after charset decoding) |
new content of message
| irc | irc_out_xxx ^(1)^ |

View File

@ -7825,7 +7825,12 @@ Paramètres :
| irc | irc_in_xxx ^(1)^ |
nom de serveur |
contenu du message reçu du serveur IRC |
contenu du message reçu du serveur IRC (avant décodage du jeu de caractères) |
nouveau contenu du message
| irc | irc_in2_xxx ^(1)^ |
nom de serveur |
contenu du message reçu du serveur IRC (après décodage du jeu de caractères) |
nouveau contenu du message
| irc | irc_out_xxx ^(1)^ |

View File

@ -6736,7 +6736,7 @@ Argomenti:
utilizzato dal plugin irc, il segnale viene inviato
anche se il messaggio è stato ignorato)
| irc | xxx,irc_out_yyy ^1^ | string: messaggio |
| irc | xxx,irc_out_yyy ^(1)^ | string: messaggio |
messaggio irc inviato al server
| irc | xxx,irc_outtags_yyy ^(1)^ | stringa: tag + ";" + messaggio |
@ -7745,17 +7745,24 @@ Argomenti:
qualsiasi stringa |
stringa con i codici colori IRC, o senza colore
| irc | irc_in_xxx ^1^ |
// TRANSLATION MISSING
| irc | irc_in_xxx ^(1)^ |
nome server |
contenuto del messaggio ricevuto dal server IRC |
contenuto del messaggio ricevuto dal server IRC (before charset decoding) |
nuovo contenuto del messaggio
| irc | irc_out_xxx ^1^ |
// TRANSLATION MISSING
| irc | irc_in2_xxx ^(1)^ |
nome server |
contenuto del messaggio ricevuto dal server IRC (after charset decoding) |
nuovo contenuto del messaggio
| irc | irc_out_xxx ^(1)^ |
nome server |
contenuto del messaggio che sta per essere inviato al server IRC |
nuovo contenuto del messaggio
| weechat | bar_condition_yyy ^2^ |
| weechat | bar_condition_yyy ^(2)^ |
stringa con puntatore alla finestra ("0x123..") |
stringa vuota |
"1" per visualizzare la barra, "0" per nasconderla
@ -7789,8 +7796,8 @@ Argomenti:
|========================================
[NOTE]
^1^ 'xxx' è il nome del comando IRC. +
^2^ 'yyy' è il nome della barra.
^(1)^ 'xxx' è il nome del comando IRC. +
^(2)^ 'yyy' è il nome della barra.
* 'callback': funzione chiamata quando viene usato il modificatore,
argomenti:

View File

@ -1902,7 +1902,7 @@ void
irc_server_msgq_flush ()
{
struct t_irc_message *next;
char *ptr_data, *new_msg, *ptr_msg, *pos;
char *ptr_data, *new_msg, *new_msg2, *ptr_msg, *ptr_msg2, *pos;
char *nick, *host, *command, *channel, *arguments;
char *msg_decoded, *msg_decoded_without_color;
char str_modifier[64], modifier_data[256];
@ -1997,24 +1997,46 @@ irc_server_msgq_flush ()
weechat_string_remove_color ((msg_decoded) ? msg_decoded : ptr_msg,
"?");
/* parse and execute command */
if (irc_redirect_message (irc_recv_msgq->server,
(msg_decoded_without_color) ?
msg_decoded_without_color : ((msg_decoded) ? msg_decoded : ptr_msg),
command, arguments))
/* call modifier after charset */
ptr_msg2 = (msg_decoded_without_color) ?
msg_decoded_without_color : ((msg_decoded) ? msg_decoded : ptr_msg);
snprintf (str_modifier, sizeof (str_modifier),
"irc_in2_%s",
(command) ? command : "unknown");
new_msg2 = weechat_hook_modifier_exec (str_modifier,
irc_recv_msgq->server->name,
ptr_msg2);
if (new_msg2 && (strcmp (ptr_msg2, new_msg2) == 0))
{
/* message redirected, we'll not display it! */
}
else
{
/* message not redirected, display it */
irc_protocol_recv_command (irc_recv_msgq->server,
(msg_decoded_without_color) ?
msg_decoded_without_color : ((msg_decoded) ? msg_decoded : ptr_msg),
command,
channel);
free (new_msg2);
new_msg2 = NULL;
}
/* message not dropped? */
if (!new_msg2 || new_msg2[0])
{
/* use new message (returned by plugin) */
if (new_msg2)
ptr_msg2 = new_msg2;
/* parse and execute command */
if (irc_redirect_message (irc_recv_msgq->server,
ptr_msg2, command,
arguments))
{
/* message redirected, we'll not display it! */
}
else
{
/* message not redirected, display it */
irc_protocol_recv_command (irc_recv_msgq->server,
ptr_msg2, command,
channel);
}
}
if (new_msg2)
free (new_msg2);
if (nick)
free (nick);
if (host)