mirror of
https://github.com/weechat/weechat.git
synced 2026-07-05 18:05:41 +02:00
Added tags for lines and custom filtering by tags or regex (task #7674), fixed many memory leaks
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -87,9 +87,16 @@ weechat_python_exec (struct t_plugin_script *script,
|
||||
{
|
||||
if (argv[4])
|
||||
{
|
||||
rc = PyObject_CallFunction (evFunc, "sssss", argv[0],
|
||||
argv[1], argv[2], argv[3],
|
||||
argv[4]);
|
||||
if (argv[5])
|
||||
{
|
||||
rc = PyObject_CallFunction (evFunc, "ssssss", argv[0],
|
||||
argv[1], argv[2], argv[3],
|
||||
argv[4], argv[5]);
|
||||
}
|
||||
else
|
||||
rc = PyObject_CallFunction (evFunc, "sssss", argv[0],
|
||||
argv[1], argv[2], argv[3],
|
||||
argv[4]);
|
||||
}
|
||||
else
|
||||
rc = PyObject_CallFunction (evFunc, "ssss", argv[0],
|
||||
@@ -315,10 +322,6 @@ weechat_python_load (char *filename)
|
||||
weechat_dict = PyModule_GetDict(weechat_module);
|
||||
PyDict_SetItemString(weechat_dict, "WEECHAT_RC_OK", PyInt_FromLong((long) WEECHAT_RC_OK));
|
||||
PyDict_SetItemString(weechat_dict, "WEECHAT_RC_ERROR", PyInt_FromLong((long) WEECHAT_RC_ERROR));
|
||||
PyDict_SetItemString(weechat_dict, "WEECHAT_RC_OK_IGNORE_WEECHAT", PyInt_FromLong((long) WEECHAT_RC_OK_IGNORE_WEECHAT));
|
||||
PyDict_SetItemString(weechat_dict, "WEECHAT_RC_OK_IGNORE_PLUGINS", PyInt_FromLong((long) WEECHAT_RC_OK_IGNORE_PLUGINS));
|
||||
PyDict_SetItemString(weechat_dict, "WEECHAT_RC_OK_IGNORE_ALL", PyInt_FromLong((long) WEECHAT_RC_OK_IGNORE_ALL));
|
||||
PyDict_SetItemString(weechat_dict, "WEECHAT_RC_OK_WITH_HIGHLIGHT", PyInt_FromLong((long) WEECHAT_RC_OK_WITH_HIGHLIGHT));
|
||||
PyDict_SetItemString(weechat_dict, "WEECHAT_LIST_POS_SORT", PyString_FromString(WEECHAT_LIST_POS_SORT));
|
||||
PyDict_SetItemString(weechat_dict, "WEECHAT_LIST_POS_BEGINNING", PyString_FromString(WEECHAT_LIST_POS_BEGINNING));
|
||||
PyDict_SetItemString(weechat_dict, "WEECHAT_LIST_POS_END", PyString_FromString(WEECHAT_LIST_POS_END));
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -124,13 +124,25 @@ weechat_ruby_exec (struct t_plugin_script *script,
|
||||
{
|
||||
if (argv[4])
|
||||
{
|
||||
rc = rb_protect_funcall ((VALUE) script->interpreter, rb_intern(function),
|
||||
&ruby_error, 5,
|
||||
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]));
|
||||
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]));
|
||||
}
|
||||
else
|
||||
rc = rb_protect_funcall ((VALUE) script->interpreter, rb_intern(function),
|
||||
&ruby_error, 5,
|
||||
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]));
|
||||
}
|
||||
else
|
||||
rc = rb_protect_funcall ((VALUE) script->interpreter, rb_intern(function),
|
||||
|
||||
@@ -481,11 +481,12 @@ struct t_hook *
|
||||
script_api_hook_print (struct t_weechat_plugin *weechat_plugin,
|
||||
struct t_plugin_script *script,
|
||||
struct t_gui_buffer *buffer,
|
||||
char *message, int strip_colors,
|
||||
char *tags, char *message, int strip_colors,
|
||||
int (*callback)(void *data,
|
||||
struct t_gui_buffer *buffer,
|
||||
time_t date, char *prefix,
|
||||
char *message),
|
||||
time_t date,
|
||||
int tags_count, char **tags,
|
||||
char *prefix, char *message),
|
||||
char *function)
|
||||
{
|
||||
struct t_script_callback *new_script_callback;
|
||||
@@ -495,7 +496,7 @@ script_api_hook_print (struct t_weechat_plugin *weechat_plugin,
|
||||
if (!new_script_callback)
|
||||
return NULL;
|
||||
|
||||
new_hook = weechat_hook_print (buffer, message, strip_colors,
|
||||
new_hook = weechat_hook_print (buffer, tags, message, strip_colors,
|
||||
callback, new_script_callback);
|
||||
if (!new_hook)
|
||||
{
|
||||
|
||||
@@ -95,10 +95,14 @@ extern struct t_hook *script_api_hook_fd (struct t_weechat_plugin *weechat_plugi
|
||||
extern struct t_hook *script_api_hook_print (struct t_weechat_plugin *weechat_plugin,
|
||||
struct t_plugin_script *script,
|
||||
struct t_gui_buffer *buffer,
|
||||
char *message, int strip_colors,
|
||||
char *tags,
|
||||
char *message,
|
||||
int strip_colors,
|
||||
int (*callback)(void *data,
|
||||
struct t_gui_buffer *buffer,
|
||||
time_t date,
|
||||
int tags_count,
|
||||
char **tags,
|
||||
char *prefix,
|
||||
char *message),
|
||||
char *function);
|
||||
|
||||
Reference in New Issue
Block a user