From 2ad6bb12955b3e9bfa43628e6dbfc984537f8b26 Mon Sep 17 00:00:00 2001 From: isundil Date: Thu, 1 Oct 2015 21:14:30 +0200 Subject: Fix #45 Make it easy to delete default channels, servers and networks Removing network will now also remove all attached servers --- src/core/servers-setup.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/core/servers-setup.c') diff --git a/src/core/servers-setup.c b/src/core/servers-setup.c index 90a447d4..74b818e7 100644 --- a/src/core/servers-setup.c +++ b/src/core/servers-setup.c @@ -333,6 +333,24 @@ server_create_conn(int chat_type, const char *dest, int port, chatnet, password, nick); } +GSList *server_setup_find_chatnet(const char *chatnet) +{ + GSList *servers; + GSList *tmp; + + g_return_val_if_fail(chatnet != NULL, NULL); + + servers = NULL; + for (tmp = setupservers; tmp != NULL; tmp = tmp->next) { + SERVER_SETUP_REC *rec = tmp->data; + + if (g_ascii_strcasecmp(rec->chatnet, chatnet) == 0) + servers = g_slist_append(servers, rec); + } + + return servers; +} + /* Find matching server from setup. Try to find record with a same port, but fallback to any server with the same address. */ SERVER_SETUP_REC *server_setup_find(const char *address, int port, -- cgit v1.2.3