summaryrefslogtreecommitdiff
path: root/src/core/servers-setup.c
diff options
context:
space:
mode:
authorisundil <isundill@gmail.com>2015-10-01 22:36:02 +0200
committerisundil <isundill@gmail.com>2015-10-01 22:36:02 +0200
commit6ca7dc68478772258dea114d29625dc2c87999f9 (patch)
treecfa0cab1545d4a429351509ee13c3bd13341df11 /src/core/servers-setup.c
parent2ad6bb12955b3e9bfa43628e6dbfc984537f8b26 (diff)
downloadirssi-6ca7dc68478772258dea114d29625dc2c87999f9.zip
Updated server removal
Removing network will also remove attached channels
Diffstat (limited to 'src/core/servers-setup.c')
-rw-r--r--src/core/servers-setup.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/core/servers-setup.c b/src/core/servers-setup.c
index 74b818e7..cd5fe406 100644
--- a/src/core/servers-setup.c
+++ b/src/core/servers-setup.c
@@ -333,24 +333,6 @@ 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,
@@ -523,6 +505,21 @@ void server_setup_add(SERVER_SETUP_REC *rec)
signal_emit("server setup updated", 1, rec);
}
+void server_setup_remove_chatnet(const char *chatnet)
+{
+ GSList *tmp, *next;
+
+ g_return_val_if_fail(chatnet != NULL, NULL);
+
+ for (tmp = setupservers; tmp != NULL; tmp = next) {
+ SERVER_SETUP_REC *rec = tmp->data;
+
+ next = tmp->next;
+ if (g_ascii_strcasecmp(rec->chatnet, chatnet) == 0)
+ server_setup_remove(rec);
+ }
+}
+
void server_setup_remove(SERVER_SETUP_REC *rec)
{
server_setup_remove_config(rec);