about summary refs log tree commit diff stats
path: root/src/window_list.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/window_list.c')
-rw-r--r--src/window_list.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/window_list.c b/src/window_list.c
index 01d5d412..4f2d86e0 100644
--- a/src/window_list.c
+++ b/src/window_list.c
@@ -226,6 +226,29 @@ wins_get_plugin(const char *const tag)
     return NULL;
 }
 
+void
+wins_close_plugin(const char *const tag)
+{
+    GList *values = g_hash_table_get_values(windows);
+    GList *curr = values;
+
+    while (curr) {
+        ProfWin *window = curr->data;
+        if (window->type == WIN_PLUGIN) {
+            ProfPluginWin *pluginwin = (ProfPluginWin*)window;
+            if (g_strcmp0(pluginwin->tag, tag) == 0) {
+                int num = wins_get_num(window);
+                wins_close_by_num(num);
+                g_list_free(values);
+                return;
+            }
+        }
+        curr = g_list_next(curr);
+    }
+
+    g_list_free(values);
+}
+
 GList*
 wins_get_private_chats(const char *const roomjid)
 {