Bug fixes::
* core: fix wrong terminal title on terminal resize (issue #1702)
+ * api: change type of argument remaining_calls in hook_timer callback from string to integer (in scripts)
* irc: fix duplicated channels in autojoin option when autojoin_dynamic is enabled (issue #1795)
* irc: fix display of TOPIC and QUIT messages with an empty trailing parameter (issue #1797)
* irc: fix parsing of messages with trailing spaces and no trailing parameter (issue #1803)
[[v3.7]]
== Version 3.7 (under dev)
+[[v3.7_hook_timer_callback_remaining_calls]]
+=== Argument "remaining_calls" in callback of hook_timer
+
+In all script languages (except PHP), the argument "remaining_calls" sent to the
+callback of "hook_timer" is now an integer (it was a string in older releases).
+
+To be compatible with all versions, it is recommended to convert the argument
+to integer before testing it, for example in Python:
+
+[source,python]
+----
+if int(remaining_calls) > 0:
+ # ...
+----
+
[[v3.7_delete_previous_word_whitespace]]
=== Delete previous word until whitespace
=== Function hook_print
In scripts, the arguments "displayed" and "highlight" sent to the callback of
-"hook_print" are now integers (they were strings in older releases). +
+"hook_print" are now integers (they were strings in older releases).
+
To be compatible with all versions, it is recommended to convert the argument
-to integer before testing it, for example in Python: `if int(highlight):`.
+to integer before testing it, for example in Python:
+
+[source,python]
+----
+if int(highlight):
+ # ...
+----
[[v0.4.3]]
== Version 0.4.3 (2014-02-09)
def hook_timer(interval: int, align_second: int, max_calls: int, callback: str, callback_data: str) -> str: ...
# example
-def my_timer_cb(data: str, remaining_calls: str) -> int:
+def my_timer_cb(data: str, remaining_calls: int) -> int:
# ...
return weechat.WEECHAT_RC_OK
def hook_timer(interval: int, align_second: int, max_calls: int, callback: str, callback_data: str) -> str: ...
# exemple
-def my_timer_cb(data: str, remaining_calls: str) -> int:
+def my_timer_cb(data: str, remaining_calls: int) -> int:
# ...
return weechat.WEECHAT_RC_OK
def hook_timer(interval: int, align_second: int, max_calls: int, callback: str, callback_data: str) -> str: ...
# esempio
-def my_timer_cb(data: str, remaining_calls: str) -> int:
+def my_timer_cb(data: str, remaining_calls: int) -> int:
# ...
return weechat.WEECHAT_RC_OK
def hook_timer(interval: int, align_second: int, max_calls: int, callback: str, callback_data: str) -> str: ...
# 例
-def my_timer_cb(data: str, remaining_calls: str) -> int:
+def my_timer_cb(data: str, remaining_calls: int) -> int:
# ...
return weechat.WEECHAT_RC_OK
def hook_timer(interval: int, align_second: int, max_calls: int, callback: str, callback_data: str) -> str: ...
# пример
-def my_timer_cb(data: str, remaining_calls: str) -> int:
+def my_timer_cb(data: str, remaining_calls: int) -> int:
# ...
return weechat.WEECHAT_RC_OK
{
struct t_plugin_script *script;
void *func_argv[2];
- char str_remaining_calls[32], empty_arg[1] = { '\0' };
+ char empty_arg[1] = { '\0' };
const char *ptr_function, *ptr_data;
int *rc, ret;
if (ptr_function && ptr_function[0])
{
- snprintf (str_remaining_calls, sizeof (str_remaining_calls),
- "%d", remaining_calls);
-
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
- func_argv[1] = str_remaining_calls;
+ func_argv[1] = &remaining_calls;
rc = (int *) weechat_guile_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
ptr_function,
- "ss", func_argv);
+ "si", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
{
struct t_plugin_script *script;
void *func_argv[2];
- char str_remaining_calls[32], empty_arg[1] = { '\0' };
+ char empty_arg[1] = { '\0' };
const char *ptr_function, *ptr_data;
int *rc, ret;
if (ptr_function && ptr_function[0])
{
- snprintf (str_remaining_calls, sizeof (str_remaining_calls),
- "%d", remaining_calls);
-
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
- func_argv[1] = str_remaining_calls;
+ func_argv[1] = &remaining_calls;
rc = (int *)weechat_js_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
ptr_function,
- "ss", func_argv);
+ "si", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
{
struct t_plugin_script *script;
void *func_argv[2];
- char str_remaining_calls[32], empty_arg[1] = { '\0' };
+ char empty_arg[1] = { '\0' };
const char *ptr_function, *ptr_data;
int *rc, ret;
if (ptr_function && ptr_function[0])
{
- snprintf (str_remaining_calls, sizeof (str_remaining_calls),
- "%d", remaining_calls);
-
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
- func_argv[1] = str_remaining_calls;
+ func_argv[1] = &remaining_calls;
rc = (int *) weechat_lua_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
ptr_function,
- "ss", func_argv);
+ "si", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
{
struct t_plugin_script *script;
void *func_argv[2];
- char str_remaining_calls[32], empty_arg[1] = { '\0' };
+ char empty_arg[1] = { '\0' };
const char *ptr_function, *ptr_data;
int *rc, ret;
if (ptr_function && ptr_function[0])
{
- snprintf (str_remaining_calls, sizeof (str_remaining_calls),
- "%d", remaining_calls);
-
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
- func_argv[1] = str_remaining_calls;
+ func_argv[1] = &remaining_calls;
rc = (int *) weechat_perl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
ptr_function,
- "ss", func_argv);
+ "si", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
{
struct t_plugin_script *script;
void *func_argv[2];
- char str_remaining_calls[32], empty_arg[1] = { '\0' };
+ char empty_arg[1] = { '\0' };
const char *ptr_function, *ptr_data;
int *rc, ret;
if (ptr_function && ptr_function[0])
{
- snprintf (str_remaining_calls, sizeof (str_remaining_calls),
- "%d", remaining_calls);
-
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
- func_argv[1] = str_remaining_calls;
+ func_argv[1] = &remaining_calls;
rc = (int *) weechat_python_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
ptr_function,
- "ss", func_argv);
+ "si", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
{
struct t_plugin_script *script;
void *func_argv[2];
- char str_remaining_calls[32], empty_arg[1] = { '\0' };
+ char empty_arg[1] = { '\0' };
const char *ptr_function, *ptr_data;
int *rc, ret;
if (ptr_function && ptr_function[0])
{
- snprintf (str_remaining_calls, sizeof (str_remaining_calls),
- "%d", remaining_calls);
-
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
- func_argv[1] = str_remaining_calls;
+ func_argv[1] = &remaining_calls;
rc = (int *) weechat_ruby_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
ptr_function,
- "ss", func_argv);
+ "si", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
{
struct t_plugin_script *script;
void *func_argv[2];
- char str_remaining_calls[32], empty_arg[1] = { '\0' };
+ char empty_arg[1] = { '\0' };
const char *ptr_function, *ptr_data;
int *rc, ret;
if (ptr_function && ptr_function[0])
{
- snprintf (str_remaining_calls, sizeof (str_remaining_calls),
- "%d", remaining_calls);
-
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
- func_argv[1] = str_remaining_calls;
+ func_argv[1] = &remaining_calls;
rc = (int *) weechat_tcl_exec (script,
WEECHAT_SCRIPT_EXEC_INT,
ptr_function,
- "ss", func_argv);
+ "si", func_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;