mirror of
https://github.com/weechat/weechat.git
synced 2026-06-26 21:06:38 +02:00
core: add support of date and tags in messages displayed in buffers with free content, add function printf_y_date_tags (closes #1746)
This commit is contained in:
@@ -326,7 +326,7 @@ plugin_script_api_printf (struct t_weechat_plugin *weechat_plugin,
|
||||
}
|
||||
|
||||
/*
|
||||
* Prints a message with optional date and tags.
|
||||
* Prints a message, with optional date and tags.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -377,6 +377,33 @@ plugin_script_api_printf_y (struct t_weechat_plugin *weechat_plugin,
|
||||
free (vbuffer);
|
||||
}
|
||||
|
||||
/*
|
||||
* Prints a message on a buffer with free content, with optional date and tags.
|
||||
*/
|
||||
|
||||
void
|
||||
plugin_script_api_printf_y_date_tags (struct t_weechat_plugin *weechat_plugin,
|
||||
struct t_plugin_script *script,
|
||||
struct t_gui_buffer *buffer, int y,
|
||||
time_t date, const char *tags,
|
||||
const char *format, ...)
|
||||
{
|
||||
char *buf2;
|
||||
|
||||
weechat_va_format (format);
|
||||
if (!vbuffer)
|
||||
return;
|
||||
|
||||
buf2 = (script && script->charset && script->charset[0]) ?
|
||||
weechat_iconv_to_internal (script->charset, vbuffer) : NULL;
|
||||
weechat_printf_y_date_tags (buffer, y, date, tags,
|
||||
"%s", (buf2) ? buf2 : vbuffer);
|
||||
if (buf2)
|
||||
free (buf2);
|
||||
|
||||
free (vbuffer);
|
||||
}
|
||||
|
||||
/*
|
||||
* Prints a message in WeeChat log file.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user