summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/ruby/weechat-ruby.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-11-29 17:44:42 +0100
committerSebastien Helleu <flashcode@flashtux.org>2008-11-29 17:44:42 +0100
commitbf0b5f5644abbf0a79674af7e75f6e24981babfc (patch)
treee3bd5fb98c83ba64f8f0f922084e6e941644529a /src/plugins/scripts/ruby/weechat-ruby.c
parentbc00946a0da47dbc16cefbb915ae7f94b0ac3abf (diff)
downloadweechat-bf0b5f5644abbf0a79674af7e75f6e24981babfc.zip
Add "displayed" and "highlight" arguments to callback for hook_print
Diffstat (limited to 'src/plugins/scripts/ruby/weechat-ruby.c')
-rw-r--r--src/plugins/scripts/ruby/weechat-ruby.c43
1 files changed, 35 insertions, 8 deletions
diff --git a/src/plugins/scripts/ruby/weechat-ruby.c b/src/plugins/scripts/ruby/weechat-ruby.c
index 83f96dd50..53a616018 100644
--- a/src/plugins/scripts/ruby/weechat-ruby.c
+++ b/src/plugins/scripts/ruby/weechat-ruby.c
@@ -130,16 +130,32 @@ weechat_ruby_exec (struct t_plugin_script *script,
{
if (argv[5])
{
- rc = rb_protect_funcall ((VALUE) script->interpreter, rb_intern(function),
- &ruby_error, 6,
- rb_str_new2(argv[0]),
- rb_str_new2(argv[1]),
- rb_str_new2(argv[2]),
- rb_str_new2(argv[3]),
- rb_str_new2(argv[4]),
- rb_str_new2(argv[5]));
+ if (argv[6])
+ {
+ rc = rb_protect_funcall ((VALUE) script->interpreter, rb_intern(function),
+ &ruby_error, 7,
+ rb_str_new2(argv[0]),
+ rb_str_new2(argv[1]),
+ rb_str_new2(argv[2]),
+ rb_str_new2(argv[3]),
+ rb_str_new2(argv[4]),
+ rb_str_new2(argv[5]),
+ rb_str_new2(argv[6]));
+ }
+ else
+ {
+ rc = rb_protect_funcall ((VALUE) script->interpreter, rb_intern(function),
+ &ruby_error, 6,
+ rb_str_new2(argv[0]),
+ rb_str_new2(argv[1]),
+ rb_str_new2(argv[2]),
+ rb_str_new2(argv[3]),
+ rb_str_new2(argv[4]),
+ rb_str_new2(argv[5]));
+ }
}
else
+ {
rc = rb_protect_funcall ((VALUE) script->interpreter, rb_intern(function),
&ruby_error, 5,
rb_str_new2(argv[0]),
@@ -147,36 +163,47 @@ weechat_ruby_exec (struct t_plugin_script *script,
rb_str_new2(argv[2]),
rb_str_new2(argv[3]),
rb_str_new2(argv[4]));
+ }
}
else
+ {
rc = rb_protect_funcall ((VALUE) script->interpreter, rb_intern(function),
&ruby_error, 4,
rb_str_new2(argv[0]),
rb_str_new2(argv[1]),
rb_str_new2(argv[2]),
rb_str_new2(argv[3]));
+ }
}
else
+ {
rc = rb_protect_funcall ((VALUE) script->interpreter, rb_intern(function),
&ruby_error, 3,
rb_str_new2(argv[0]),
rb_str_new2(argv[1]),
rb_str_new2(argv[2]));
+ }
}
else
+ {
rc = rb_protect_funcall ((VALUE) script->interpreter, rb_intern(function),
&ruby_error, 2,
rb_str_new2(argv[0]),
rb_str_new2(argv[1]));
+ }
}
else
+ {
rc = rb_protect_funcall ((VALUE) script->interpreter, rb_intern(function),
&ruby_error, 1,
rb_str_new2(argv[0]));
+ }
}
else
+ {
rc = rb_protect_funcall ((VALUE) script->interpreter, rb_intern(function),
&ruby_error, 0);
+ }
if (ruby_error)
{