Remove plugin window on /close
This commit is contained in:
@@ -313,7 +313,7 @@ api_win_create(
|
||||
|
||||
callbacks_add_window_handler(plugin_name, tag, window);
|
||||
|
||||
wins_new_plugin(tag);
|
||||
wins_new_plugin(plugin_name, tag);
|
||||
|
||||
// set status bar active
|
||||
ProfPluginWin *pluginwin = wins_get_plugin(tag);
|
||||
|
||||
@@ -220,6 +220,16 @@ callbacks_win_exists(const char *const plugin_name, const char *tag)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
callbacks_remove_win(const char *const plugin_name, const char *const tag)
|
||||
{
|
||||
GHashTable *window_callbacks = g_hash_table_lookup(p_window_callbacks, plugin_name);
|
||||
if (window_callbacks) {
|
||||
g_hash_table_remove(window_callbacks, tag);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
callbacks_add_window_handler(const char *const plugin_name, const char *tag, PluginWindowCallback *window_callback)
|
||||
{
|
||||
|
||||
@@ -72,5 +72,6 @@ void callbacks_add_timed(const char *const plugin_name, PluginTimedFunction *tim
|
||||
gboolean callbacks_win_exists(const char *const plugin_name, const char *tag);
|
||||
void callbacks_add_window_handler(const char *const plugin_name, const char *tag, PluginWindowCallback *window_callback);
|
||||
void * callbacks_get_window_handler(const char *tag);
|
||||
void callbacks_remove_win(const char *const plugin_name, const char *const tag);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -286,6 +286,12 @@ plugins_win_process_line(char *win, const char * const line)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
plugins_close_win(const char *const plugin_name, const char *const tag)
|
||||
{
|
||||
callbacks_remove_win(plugin_name, tag);
|
||||
}
|
||||
|
||||
void
|
||||
plugins_on_start(void)
|
||||
{
|
||||
|
||||
@@ -134,6 +134,7 @@ char* plugins_pre_priv_message_send(const char *const jid, const char *const mes
|
||||
void plugins_post_priv_message_send(const char *const jid, const char *const message);
|
||||
|
||||
void plugins_win_process_line(char *win, const char *const line);
|
||||
void plugins_close_win(const char *const plugin_name, const char *const tag);
|
||||
|
||||
char* plugins_on_message_stanza_send(const char *const text);
|
||||
gboolean plugins_on_message_stanza_receive(const char *const text);
|
||||
|
||||
Reference in New Issue
Block a user