mirror of
https://github.com/profanity-im/profanity.git
synced 2025-02-02 15:08:15 -05:00
Merge branch 'master' into osx-functional
This commit is contained in:
commit
c33e2abc81
@ -113,10 +113,12 @@ c_plugin_create(const char *const filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
c_init_hook(ProfPlugin *plugin, const char *const version, const char *const status)
|
c_init_hook(ProfPlugin *plugin, const char *const version, const char *const status, const char *const account_name,
|
||||||
|
const char *const fulljid)
|
||||||
{
|
{
|
||||||
void *f = NULL;
|
void *f = NULL;
|
||||||
void (*func)(const char *const __version, const char *const __status);
|
void (*func)(const char *const __version, const char *const __status, const char *const __account_name,
|
||||||
|
const char *const __fulljid);
|
||||||
|
|
||||||
assert(plugin && plugin->module);
|
assert(plugin && plugin->module);
|
||||||
|
|
||||||
@ -125,10 +127,10 @@ c_init_hook(ProfPlugin *plugin, const char *const version, const char *const sta
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
func = (void (*)(const char *const, const char *const))f;
|
func = (void (*)(const char *const, const char *const, const char *const, const char *const))f;
|
||||||
|
|
||||||
// FIXME maybe we want to make it boolean to see if it succeeded or not?
|
// FIXME maybe we want to make it boolean to see if it succeeded or not?
|
||||||
func(version, status);
|
func(version, status, account_name, fulljid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -43,7 +43,8 @@ ProfPlugin* c_plugin_create(const char *const filename);
|
|||||||
void c_plugin_destroy(ProfPlugin *plugin);
|
void c_plugin_destroy(ProfPlugin *plugin);
|
||||||
void c_shutdown(void);
|
void c_shutdown(void);
|
||||||
|
|
||||||
void c_init_hook(ProfPlugin *plugin, const char *const version, const char *const status);
|
void c_init_hook(ProfPlugin *plugin, const char *const version, const char *const status, const char *const account_name,
|
||||||
|
const char *const fulljid);
|
||||||
void c_on_start_hook(ProfPlugin *plugin);
|
void c_on_start_hook(ProfPlugin *plugin);
|
||||||
void c_on_shutdown_hook(ProfPlugin *plugin);
|
void c_on_shutdown_hook(ProfPlugin *plugin);
|
||||||
void c_on_connect_hook(ProfPlugin *plugin, const char *const account_name, const char *const fulljid);
|
void c_on_connect_hook(ProfPlugin *plugin, const char *const account_name, const char *const fulljid);
|
||||||
|
@ -114,7 +114,7 @@ plugins_init(void)
|
|||||||
GSList *curr = plugins;
|
GSList *curr = plugins;
|
||||||
while (curr) {
|
while (curr) {
|
||||||
ProfPlugin *plugin = curr->data;
|
ProfPlugin *plugin = curr->data;
|
||||||
plugin->init_func(plugin, PACKAGE_VERSION, PACKAGE_STATUS);
|
plugin->init_func(plugin, PACKAGE_VERSION, PACKAGE_STATUS, NULL, NULL);
|
||||||
curr = g_slist_next(curr);
|
curr = g_slist_next(curr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -155,7 +155,13 @@ plugins_load(const char *const name)
|
|||||||
#endif
|
#endif
|
||||||
if (plugin) {
|
if (plugin) {
|
||||||
plugins = g_slist_append(plugins, plugin);
|
plugins = g_slist_append(plugins, plugin);
|
||||||
plugin->init_func(plugin, PACKAGE_VERSION, PACKAGE_STATUS);
|
if (jabber_get_connection_status() == JABBER_CONNECTED) {
|
||||||
|
const char *account_name = jabber_get_account_name();
|
||||||
|
const char *fulljid = jabber_get_fulljid();
|
||||||
|
plugin->init_func(plugin, PACKAGE_VERSION, PACKAGE_STATUS, account_name, fulljid);
|
||||||
|
} else {
|
||||||
|
plugin->init_func(plugin, PACKAGE_VERSION, PACKAGE_STATUS, NULL, NULL);
|
||||||
|
}
|
||||||
log_info("Loaded plugin: %s", name);
|
log_info("Loaded plugin: %s", name);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else {
|
} else {
|
||||||
|
@ -47,7 +47,7 @@ typedef struct prof_plugin_t {
|
|||||||
lang_t lang;
|
lang_t lang;
|
||||||
void *module;
|
void *module;
|
||||||
void (*init_func)(struct prof_plugin_t* plugin, const char * const version,
|
void (*init_func)(struct prof_plugin_t* plugin, const char * const version,
|
||||||
const char * const status);
|
const char * const status, const char *const account_name, const char *const fulljid);
|
||||||
|
|
||||||
void (*on_start_func)(struct prof_plugin_t* plugin);
|
void (*on_start_func)(struct prof_plugin_t* plugin);
|
||||||
void (*on_shutdown_func)(struct prof_plugin_t* plugin);
|
void (*on_shutdown_func)(struct prof_plugin_t* plugin);
|
||||||
|
@ -128,10 +128,11 @@ python_plugin_create(const char *const filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
python_init_hook(ProfPlugin *plugin, const char *const version, const char *const status)
|
python_init_hook(ProfPlugin *plugin, const char *const version, const char *const status, const char *const account_name,
|
||||||
|
const char *const fulljid)
|
||||||
{
|
{
|
||||||
disable_python_threads();
|
disable_python_threads();
|
||||||
PyObject *p_args = Py_BuildValue("ss", version, status);
|
PyObject *p_args = Py_BuildValue("ssss", version, status, account_name, fulljid);
|
||||||
PyObject *p_function;
|
PyObject *p_function;
|
||||||
|
|
||||||
PyObject *p_module = plugin->module;
|
PyObject *p_module = plugin->module;
|
||||||
|
@ -43,7 +43,8 @@ void python_check_error(void);
|
|||||||
void allow_python_threads();
|
void allow_python_threads();
|
||||||
void disable_python_threads();
|
void disable_python_threads();
|
||||||
|
|
||||||
void python_init_hook(ProfPlugin *plugin, const char *const version, const char *const status);
|
void python_init_hook(ProfPlugin *plugin, const char *const version, const char *const status,
|
||||||
|
const char *const account_name, const char *const fulljid);
|
||||||
void python_on_start_hook(ProfPlugin *plugin);
|
void python_on_start_hook(ProfPlugin *plugin);
|
||||||
void python_on_shutdown_hook(ProfPlugin *plugin);
|
void python_on_shutdown_hook(ProfPlugin *plugin);
|
||||||
void python_on_connect_hook(ProfPlugin *plugin, const char *const account_name, const char *const fulljid);
|
void python_on_connect_hook(ProfPlugin *plugin, const char *const account_name, const char *const fulljid);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user