diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-01-29 14:24:31 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-01-29 14:24:31 +0100 |
commit | 498dbc92436aa3deace8ec8b2ea6dcf109fce8c8 (patch) | |
tree | f11d0086b4f37d0cefb8d56aeb66e05489c844fc | |
parent | c35fb9e847d919a88342d58f93124a89d1696a5d (diff) | |
download | weechat-498dbc92436aa3deace8ec8b2ea6dcf109fce8c8.zip |
Added command in demo plugin to set a buffer property
-rw-r--r-- | src/plugins/demo/demo.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/plugins/demo/demo.c b/src/plugins/demo/demo.c index 16c991553..f5fe25412 100644 --- a/src/plugins/demo/demo.c +++ b/src/plugins/demo/demo.c @@ -150,6 +150,25 @@ demo_buffer_command_cb (void *data, struct t_gui_buffer *buffer, int argc, } /* + * 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"), |