mirror of
https://github.com/profanity-im/profanity.git
synced 2025-07-26 12:14:28 -04:00
Plugins fixed return values for python stanza hooks
This commit is contained in:
parent
b3a3351a35
commit
8f009c3c8d
@ -646,7 +646,7 @@ python_on_message_stanza_receive_hook(ProfPlugin *plugin, const char *const text
|
|||||||
PyObject *result = PyObject_CallObject(p_function, p_args);
|
PyObject *result = PyObject_CallObject(p_function, p_args);
|
||||||
python_check_error();
|
python_check_error();
|
||||||
Py_XDECREF(p_function);
|
Py_XDECREF(p_function);
|
||||||
if (PyBool_Check(result)) {
|
if (PyObject_IsTrue(result)) {
|
||||||
allow_python_threads();
|
allow_python_threads();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else {
|
} else {
|
||||||
@ -711,7 +711,7 @@ python_on_presence_stanza_receive_hook(ProfPlugin *plugin, const char *const tex
|
|||||||
PyObject *result = PyObject_CallObject(p_function, p_args);
|
PyObject *result = PyObject_CallObject(p_function, p_args);
|
||||||
python_check_error();
|
python_check_error();
|
||||||
Py_XDECREF(p_function);
|
Py_XDECREF(p_function);
|
||||||
if (PyBool_Check(result)) {
|
if (PyObject_IsTrue(result)) {
|
||||||
allow_python_threads();
|
allow_python_threads();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else {
|
} else {
|
||||||
@ -776,7 +776,7 @@ python_on_iq_stanza_receive_hook(ProfPlugin *plugin, const char *const text)
|
|||||||
PyObject *result = PyObject_CallObject(p_function, p_args);
|
PyObject *result = PyObject_CallObject(p_function, p_args);
|
||||||
python_check_error();
|
python_check_error();
|
||||||
Py_XDECREF(p_function);
|
Py_XDECREF(p_function);
|
||||||
if (PyBool_Check(result)) {
|
if (PyObject_IsTrue(result)) {
|
||||||
allow_python_threads();
|
allow_python_threads();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user