1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 20:36:38 +02:00

Added command in demo plugin to set a buffer property

This commit is contained in:
Sebastien Helleu
2008-01-29 14:24:31 +01:00
parent c35fb9e847
commit 498dbc9243
+26
View File
@@ -149,6 +149,25 @@ demo_buffer_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
return WEECHAT_RC_OK;
}
/*
* demo_buffer_set_command_cb: demo command for setting buffer property
*/
int
demo_buffer_set_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
char **argv, char **argv_eol)
{
/* make C compiler happy */
(void) data;
if (argc > 2)
{
weechat_buffer_set (buffer, argv[1], argv_eol[2]);
}
return WEECHAT_RC_OK;
}
/*
* demo_infolist_print: display an infolist
*/
@@ -356,6 +375,13 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
"",
"",
&demo_buffer_command_cb, NULL);
weechat_hook_command ("demo_buffer_set",
_("set a buffer property"),
_("property value"),
"",
"",
&demo_buffer_set_command_cb, NULL);
weechat_hook_command ("demo_infolist",
_("get and display an infolist"),