From 4c913aa08baa5e27972ee10d453e440c13fb7fb7 Mon Sep 17 00:00:00 2001 From: James Booth Date: Wed, 23 Mar 2016 22:57:03 +0000 Subject: Added prof_send_stanza to plugins API --- src/plugins/python_api.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/plugins/python_api.c') diff --git a/src/plugins/python_api.c b/src/plugins/python_api.c index 42222065..7d0ebc89 100644 --- a/src/plugins/python_api.c +++ b/src/plugins/python_api.c @@ -433,6 +433,24 @@ python_api_win_show_themed(PyObject *self, PyObject *args) return Py_BuildValue(""); } +static PyObject* +python_api_send_stanza(PyObject *self, PyObject *args) +{ + const char *stanza = NULL; + if (!PyArg_ParseTuple(args, "s", &stanza)) { + return Py_BuildValue("i", 0); + } + + allow_python_threads(); + int res = api_send_stanza(stanza); + disable_python_threads(); + if (res) { + return Py_BuildValue("i", 1); + } else { + return Py_BuildValue("i", 0); + } +} + void python_command_callback(PluginCommand *command, gchar **args) { @@ -522,6 +540,7 @@ static PyMethodDef apiMethods[] = { { "win_focus", python_api_win_focus, METH_VARARGS, "Focus a window." }, { "win_show", python_api_win_show, METH_VARARGS, "Show text in the window." }, { "win_show_themed", python_api_win_show_themed, METH_VARARGS, "Show themed text in the window." }, + { "send_stanza", python_api_send_stanza, METH_VARARGS, "Send an XMPP stanza." }, { NULL, NULL, 0, NULL } }; -- cgit 1.4.1-2-gfad0 d/.gitignore?id=e1835dfcc338ddadc2e2c327ec957afb9b508cfa'>diff stats
path: root/.emacs.d/.gitignore
blob: 67bb16525b87c078d6c5506ab1d42fccf1d819b9 (plain) (tree)