1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

/DISCONNECT <tag> works again for not-yet-connected servers.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2874 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-08-09 11:17:31 +00:00 committed by cras
parent 452db286da
commit 2ad623acd0
3 changed files with 22 additions and 1 deletions

View File

@ -245,8 +245,11 @@ static void cmd_disconnect(const char *data, SERVER_REC *server)
if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST, &tag, &msg)) if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST, &tag, &msg))
return; return;
if (*tag != '\0' && strcmp(tag, "*") != 0) if (*tag != '\0' && strcmp(tag, "*") != 0) {
server = server_find_tag(tag); server = server_find_tag(tag);
if (server == NULL)
server = server_find_lookup_tag(tag);
}
if (server == NULL) cmd_param_error(CMDERR_NOT_CONNECTED); if (server == NULL) cmd_param_error(CMDERR_NOT_CONNECTED);
if (*msg == '\0') msg = (char *) settings_get_str("quit_message"); if (*msg == '\0') msg = (char *) settings_get_str("quit_message");

View File

@ -481,6 +481,23 @@ SERVER_REC *server_find_tag(const char *tag)
return NULL; return NULL;
} }
SERVER_REC *server_find_lookup_tag(const char *tag)
{
GSList *tmp;
g_return_val_if_fail(tag != NULL, NULL);
if (*tag == '\0') return NULL;
for (tmp = lookup_servers; tmp != NULL; tmp = tmp->next) {
SERVER_REC *server = tmp->data;
if (g_strcasecmp(server->tag, tag) == 0)
return server;
}
return NULL;
}
SERVER_REC *server_find_chatnet(const char *chatnet) SERVER_REC *server_find_chatnet(const char *chatnet)
{ {
GSList *tmp; GSList *tmp;

View File

@ -46,6 +46,7 @@ void server_ref(SERVER_REC *server);
int server_unref(SERVER_REC *server); int server_unref(SERVER_REC *server);
SERVER_REC *server_find_tag(const char *tag); SERVER_REC *server_find_tag(const char *tag);
SERVER_REC *server_find_lookup_tag(const char *tag);
SERVER_REC *server_find_chatnet(const char *chatnet); SERVER_REC *server_find_chatnet(const char *chatnet);
/* starts connecting to server */ /* starts connecting to server */