diff options
author | Timo Sirainen <cras@irssi.org> | 2004-07-11 21:31:49 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2004-07-11 21:31:49 +0000 |
commit | ab3ba54ab438b2487fb5dfe169ef21975855974c (patch) | |
tree | f404ad2216a0a16f5fe1daea862bf254a90f77b4 /src/fe-common/irc | |
parent | d9cc888daa56423c8630898df0e0d003337de066 (diff) | |
download | irssi-ab3ba54ab438b2487fb5dfe169ef21975855974c.zip |
s/ircnet/network/ - patch by Joost Vunderink
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3270 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/irc')
-rw-r--r-- | src/fe-common/irc/fe-irc-server.c | 12 | ||||
-rw-r--r-- | src/fe-common/irc/fe-ircnet.c | 36 | ||||
-rw-r--r-- | src/fe-common/irc/module-formats.c | 12 | ||||
-rw-r--r-- | src/fe-common/irc/module-formats.h | 12 |
4 files changed, 39 insertions, 33 deletions
diff --git a/src/fe-common/irc/fe-irc-server.c b/src/fe-common/irc/fe-irc-server.c index a07ff6d0..a9a3751a 100644 --- a/src/fe-common/irc/fe-irc-server.c +++ b/src/fe-common/irc/fe-irc-server.c @@ -52,16 +52,22 @@ const char *get_visible_target(IRC_SERVER_REC *server, const char *target) } /* SYNTAX: SERVER ADD [-4 | -6] [-ssl] [-ssl_cert <cert>] [-ssl_pkey <pkey>] [-ssl_verify] [-ssl_cafile <cafile>] [-ssl_capath <capath>] - [-auto | -noauto] [-ircnet <ircnet>] [-host <hostname>] + [-auto | -noauto] [-network <network>] [-host <hostname>] [-cmdspeed <ms>] [-cmdmax <count>] [-port <port>] <address> [<port> [<password>]] */ +/* NOTE: -network replaces the old -ircnet flag. */ static void sig_server_add_fill(IRC_SERVER_SETUP_REC *rec, GHashTable *optlist) { IRC_CHATNET_REC *ircnet; char *value; - value = g_hash_table_lookup(optlist, "ircnet"); + value = g_hash_table_lookup(optlist, "network"); + /* For backwards compatibility, also allow the old name 'ircnet'. + But of course only if -network was not given. */ + if (!value) + value = g_hash_table_lookup(optlist, "ircnet"); + if (value != NULL) { g_free_and_null(rec->chatnet); if (*value != '\0') { @@ -139,7 +145,7 @@ void fe_irc_server_init(void) signal_add("server add fill", (SIGNAL_FUNC) sig_server_add_fill); command_bind("server list", NULL, (SIGNAL_FUNC) cmd_server_list); - command_set_options("server add", "-ircnet -cmdspeed -cmdmax -querychans"); + command_set_options("server add", "-ircnet -network -cmdspeed -cmdmax -querychans"); } void fe_irc_server_deinit(void) diff --git a/src/fe-common/irc/fe-ircnet.c b/src/fe-common/irc/fe-ircnet.c index 850117c4..371ae0bf 100644 --- a/src/fe-common/irc/fe-ircnet.c +++ b/src/fe-common/irc/fe-ircnet.c @@ -36,7 +36,7 @@ static void cmd_ircnet_list(void) GSList *tmp; str = g_string_new(NULL); - printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_IRCNET_HEADER); + printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_NETWORK_HEADER); for (tmp = chatnets; tmp != NULL; tmp = tmp->next) { IRC_CHATNET_REC *rec = tmp->data; @@ -75,13 +75,13 @@ static void cmd_ircnet_list(void) if (str->len > 1) g_string_truncate(str, str->len-2); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, - IRCTXT_IRCNET_LINE, rec->name, str->str); + IRCTXT_NETWORK_LINE, rec->name, str->str); } g_string_free(str, TRUE); - printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_IRCNET_FOOTER); + printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_NETWORK_FOOTER); } -/* SYNTAX: IRCNET ADD [-nick <nick>] [-user <user>] [-realname <name>] +/* SYNTAX: NETWORK ADD [-nick <nick>] [-user <user>] [-realname <name>] [-host <host>] [-autosendcmd <cmd>] [-querychans <count>] [-whois <count>] [-msgs <count>] [-kicks <count>] [-modes <count>] @@ -94,7 +94,7 @@ static void cmd_ircnet_add(const char *data) IRC_CHATNET_REC *rec; if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS, - "ircnet add", &optlist, &name)) + "network add", &optlist, &name)) return; if (*name == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); @@ -149,12 +149,12 @@ static void cmd_ircnet_add(const char *data) if (value != NULL && *value != '\0') rec->autosendcmd = g_strdup(value); ircnet_create(rec); - printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_IRCNET_ADDED, name); + printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_NETWORK_ADDED, name); cmd_params_free(free_arg); } -/* SYNTAX: IRCNET REMOVE <ircnet> */ +/* SYNTAX: NETWORK REMOVE <network> */ static void cmd_ircnet_remove(const char *data) { IRC_CHATNET_REC *rec; @@ -163,9 +163,9 @@ static void cmd_ircnet_remove(const char *data) rec = ircnet_find(data); if (rec == NULL) - printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_IRCNET_NOT_FOUND, data); + printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_NETWORK_NOT_FOUND, data); else { - printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_IRCNET_REMOVED, data); + printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_NETWORK_REMOVED, data); chatnet_remove(CHATNET(rec)); } } @@ -180,18 +180,18 @@ static void cmd_ircnet(const char *data, SERVER_REC *server, WI_ITEM_REC *item) void fe_ircnet_init(void) { - command_bind("ircnet", NULL, (SIGNAL_FUNC) cmd_ircnet); - command_bind("ircnet list", NULL, (SIGNAL_FUNC) cmd_ircnet_list); - command_bind("ircnet add", NULL, (SIGNAL_FUNC) cmd_ircnet_add); - command_bind("ircnet remove", NULL, (SIGNAL_FUNC) cmd_ircnet_remove); + command_bind("network", NULL, (SIGNAL_FUNC) cmd_ircnet); + command_bind("network list", NULL, (SIGNAL_FUNC) cmd_ircnet_list); + command_bind("network add", NULL, (SIGNAL_FUNC) cmd_ircnet_add); + command_bind("network remove", NULL, (SIGNAL_FUNC) cmd_ircnet_remove); - command_set_options("ircnet add", "-kicks -msgs -modes -whois -cmdspeed -cmdmax -nick -user -realname -host -autosendcmd -querychans -usermode"); + command_set_options("network add", "-kicks -msgs -modes -whois -cmdspeed -cmdmax -nick -user -realname -host -autosendcmd -querychans -usermode"); } void fe_ircnet_deinit(void) { - command_unbind("ircnet", (SIGNAL_FUNC) cmd_ircnet); - command_unbind("ircnet list", (SIGNAL_FUNC) cmd_ircnet_list); - command_unbind("ircnet add", (SIGNAL_FUNC) cmd_ircnet_add); - command_unbind("ircnet remove", (SIGNAL_FUNC) cmd_ircnet_remove); + command_unbind("network", (SIGNAL_FUNC) cmd_ircnet); + command_unbind("network list", (SIGNAL_FUNC) cmd_ircnet_list); + command_unbind("network add", (SIGNAL_FUNC) cmd_ircnet_add); + command_unbind("network remove", (SIGNAL_FUNC) cmd_ircnet_remove); } diff --git a/src/fe-common/irc/module-formats.c b/src/fe-common/irc/module-formats.c index 4b466f1c..da5c63ba 100644 --- a/src/fe-common/irc/module-formats.c +++ b/src/fe-common/irc/module-formats.c @@ -35,12 +35,12 @@ FORMAT_REC fecommon_irc_formats[] = { { "netsplits_header", "%#Nick Channel Server Splitted server", 0 }, { "netsplits_line", "%#$[9]0 $[10]1 $[20]2 $3", 4, { 0, 0, 0, 0 } }, { "netsplits_footer", "", 0 }, - { "ircnet_added", "Ircnet $0 saved", 1, { 0 } }, - { "ircnet_removed", "Ircnet $0 removed", 1, { 0 } }, - { "ircnet_not_found", "Ircnet $0 not found", 1, { 0 } }, - { "ircnet_header", "%#Ircnets:", 0 }, - { "ircnet_line", "%#$0: $1", 2, { 0, 0 } }, - { "ircnet_footer", "", 0 }, + { "network_added", "Network $0 saved", 1, { 0 } }, + { "network_removed", "Network $0 removed", 1, { 0 } }, + { "network_not_found", "Network $0 not found", 1, { 0 } }, + { "network_header", "%#Networks:", 0 }, + { "network_line", "%#$0: $1", 2, { 0, 0 } }, + { "network_footer", "", 0 }, { "setupserver_header", "%#Server Port Network Settings", 0 }, { "setupserver_line", "%#%|$[!20]0 $[5]1 $[10]2 $3", 4, { 0, 1, 0, 0 } }, { "setupserver_footer", "", 0 }, diff --git a/src/fe-common/irc/module-formats.h b/src/fe-common/irc/module-formats.h index 78023734..ae2e55a9 100644 --- a/src/fe-common/irc/module-formats.h +++ b/src/fe-common/irc/module-formats.h @@ -13,12 +13,12 @@ enum { IRCTXT_NETSPLITS_HEADER, IRCTXT_NETSPLITS_LINE, IRCTXT_NETSPLITS_FOOTER, - IRCTXT_IRCNET_ADDED, - IRCTXT_IRCNET_REMOVED, - IRCTXT_IRCNET_NOT_FOUND, - IRCTXT_IRCNET_HEADER, - IRCTXT_IRCNET_LINE, - IRCTXT_IRCNET_FOOTER, + IRCTXT_NETWORK_ADDED, + IRCTXT_NETWORK_REMOVED, + IRCTXT_NETWORK_NOT_FOUND, + IRCTXT_NETWORK_HEADER, + IRCTXT_NETWORK_LINE, + IRCTXT_NETWORK_FOOTER, IRCTXT_SETUPSERVER_HEADER, IRCTXT_SETUPSERVER_LINE, IRCTXT_SETUPSERVER_FOOTER, |