From 92a2384ab06c542c8f6a3d0f80a54892d74dc649 Mon Sep 17 00:00:00 2001 From: Jari Matilainen Date: Sat, 18 Jun 2016 17:51:58 +0200 Subject: Add /channel modify --- src/fe-common/core/fe-channels.c | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/src/fe-common/core/fe-channels.c b/src/fe-common/core/fe-channels.c index 046d641a..fe8e4807 100644 --- a/src/fe-common/core/fe-channels.c +++ b/src/fe-common/core/fe-channels.c @@ -246,9 +246,7 @@ static void cmd_channel(const char *data, SERVER_REC *server, WI_ITEM_REC *item) } } -/* SYNTAX: CHANNEL ADD [-auto | -noauto] [-bots ] [-botcmd ] - [] */ -static void cmd_channel_add(const char *data) +static void cmd_channel_add_modify(const char *data, gboolean add) { GHashTable *optlist; CHATNET_REC *chatnetrec; @@ -257,18 +255,19 @@ static void cmd_channel_add(const char *data) void *free_arg; if (!cmd_get_params(data, &free_arg, 3 | PARAM_FLAG_OPTIONS, - "channel add", &optlist, &channel, &chatnet, &password)) + "channel add", &optlist, &channel, &chatnet, &password)) return; - if (*chatnet == '\0' || *channel == '\0') + if (*chatnet == '\0' || *channel == '\0') { cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); + } chatnetrec = chatnet_find(chatnet); if (chatnetrec == NULL) { printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, - TXT_UNKNOWN_CHATNET, chatnet); + TXT_UNKNOWN_CHATNET, chatnet); cmd_params_free(free_arg); - return; + return; } botarg = g_hash_table_lookup(optlist, "bots"); @@ -276,10 +275,17 @@ static void cmd_channel_add(const char *data) rec = channel_setup_find(channel, chatnet); if (rec == NULL) { + if (!add) { + cmd_params_free(free_arg); + printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, + TXT_CHANSETUP_NOT_FOUND, channel, chatnet); + return; + } + rec = CHAT_PROTOCOL(chatnetrec)->create_channel_setup(); rec->name = g_strdup(channel); rec->chatnet = g_strdup(chatnet); - } else { + } else if (!add) { if (g_hash_table_lookup(optlist, "bots")) g_free_and_null(rec->botmasks); if (g_hash_table_lookup(optlist, "botcmd")) g_free_and_null(rec->autosendcmd); if (*password != '\0') g_free_and_null(rec->password); @@ -299,6 +305,20 @@ static void cmd_channel_add(const char *data) cmd_params_free(free_arg); } +/* SYNTAX: CHANNEL ADD [-auto | -noauto] [-bots ] [-botcmd ] + [] */ +static void cmd_channel_add(const char *data) +{ + cmd_channel_add_modify(data, 1); +} + +/* SYNTAX: CHANNEL MODIFY [-auto | -noauto] [-bots ] [-botcmd ] + [] */ +static void cmd_channel_modify(const char *data) +{ + cmd_channel_add_modify(data, 0); +} + /* SYNTAX: CHANNEL REMOVE */ static void cmd_channel_remove(const char *data) { @@ -622,6 +642,7 @@ void fe_channels_init(void) command_bind("join", NULL, (SIGNAL_FUNC) cmd_join); command_bind("channel", NULL, (SIGNAL_FUNC) cmd_channel); command_bind("channel add", NULL, (SIGNAL_FUNC) cmd_channel_add); + command_bind("channel modify", NULL, (SIGNAL_FUNC) cmd_channel_modify); command_bind("channel remove", NULL, (SIGNAL_FUNC) cmd_channel_remove); command_bind("channel list", NULL, (SIGNAL_FUNC) cmd_channel_list); command_bind("names", NULL, (SIGNAL_FUNC) cmd_names); @@ -643,6 +664,7 @@ void fe_channels_deinit(void) command_unbind("join", (SIGNAL_FUNC) cmd_join); command_unbind("channel", (SIGNAL_FUNC) cmd_channel); command_unbind("channel add", (SIGNAL_FUNC) cmd_channel_add); + command_unbind("channel modify", (SIGNAL_FUNC) cmd_channel_modify); command_unbind("channel remove", (SIGNAL_FUNC) cmd_channel_remove); command_unbind("channel list", (SIGNAL_FUNC) cmd_channel_list); command_unbind("names", (SIGNAL_FUNC) cmd_names); -- cgit v1.2.3 From 1dd1dde1d46439dac17bb7f053f2665ed31a4a5e Mon Sep 17 00:00:00 2001 From: Jari Matilainen Date: Sat, 18 Jun 2016 17:52:26 +0200 Subject: Add /server modify --- src/fe-common/core/fe-server.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/fe-common/core/fe-server.c b/src/fe-common/core/fe-server.c index 429e6dac..f3792b47 100644 --- a/src/fe-common/core/fe-server.c +++ b/src/fe-common/core/fe-server.c @@ -104,7 +104,7 @@ static SERVER_SETUP_REC *create_server_setup(GHashTable *optlist) return server; } -static void cmd_server_add(const char *data) +static void cmd_server_add_modify(const char *data, gboolean add) { GHashTable *optlist; SERVER_SETUP_REC *rec; @@ -113,7 +113,7 @@ static void cmd_server_add(const char *data) int port; if (!cmd_get_params(data, &free_arg, 3 | PARAM_FLAG_OPTIONS, - "server add", &optlist, &addr, &portstr, &password)) + "server add", &optlist, &addr, &portstr, &password)) return; if (*addr == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); @@ -124,6 +124,13 @@ static void cmd_server_add(const char *data) rec = server_setup_find(addr, port, chatnet); if (rec == NULL) { + if (!add) { + cmd_params_free(free_arg); + printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, + TXT_SETUPSERVER_NOT_FOUND, addr, port); + return; + } + rec = create_server_setup(optlist); if (rec == NULL) { cmd_params_free(free_arg); @@ -131,7 +138,7 @@ static void cmd_server_add(const char *data) } rec->address = g_strdup(addr); rec->port = port; - } else { + } else if (!add) { value = g_hash_table_lookup(optlist, "port"); if (value != NULL && *value != '\0') rec->port = atoi(value); @@ -205,6 +212,16 @@ static void cmd_server_add(const char *data) cmd_params_free(free_arg); } +static void cmd_server_add(const char *data) +{ + cmd_server_add_modify(data, 1); +} + +static void cmd_server_modify(const char *data) +{ + cmd_server_add_modify(data, 0); +} + /* SYNTAX: SERVER REMOVE
[] [] */ static void cmd_server_remove(const char *data) { @@ -388,6 +405,7 @@ void fe_server_init(void) command_bind("server", NULL, (SIGNAL_FUNC) cmd_server); command_bind("server connect", NULL, (SIGNAL_FUNC) cmd_server_connect); command_bind("server add", NULL, (SIGNAL_FUNC) cmd_server_add); + command_bind("server modify", NULL, (SIGNAL_FUNC) cmd_server_modify); command_bind("server remove", NULL, (SIGNAL_FUNC) cmd_server_remove); command_bind_first("server", NULL, (SIGNAL_FUNC) server_command); command_bind_first("disconnect", NULL, (SIGNAL_FUNC) server_command); @@ -412,6 +430,7 @@ void fe_server_deinit(void) command_unbind("server", (SIGNAL_FUNC) cmd_server); command_unbind("server connect", (SIGNAL_FUNC) cmd_server_connect); command_unbind("server add", (SIGNAL_FUNC) cmd_server_add); + command_unbind("server modify", (SIGNAL_FUNC) cmd_server_modify); command_unbind("server remove", (SIGNAL_FUNC) cmd_server_remove); command_unbind("server", (SIGNAL_FUNC) server_command); command_unbind("disconnect", (SIGNAL_FUNC) server_command); -- cgit v1.2.3 From 421288cf5066267b60580af2b6ae511c46570bf0 Mon Sep 17 00:00:00 2001 From: Jari Matilainen Date: Sat, 18 Jun 2016 17:52:47 +0200 Subject: Add /network modify --- src/fe-common/irc/fe-ircnet.c | 47 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/src/fe-common/irc/fe-ircnet.c b/src/fe-common/irc/fe-ircnet.c index 4d7037d5..90697bba 100644 --- a/src/fe-common/irc/fe-ircnet.c +++ b/src/fe-common/irc/fe-ircnet.c @@ -88,14 +88,7 @@ static void cmd_network_list(void) printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_NETWORK_FOOTER); } -/* SYNTAX: NETWORK ADD [-nick ] [-user ] [-realname ] - [-host ] [-usermode ] [-autosendcmd ] - [-querychans ] [-whois ] [-msgs ] - [-kicks ] [-modes ] [-cmdspeed ] - [-cmdmax ] [-sasl_mechanism ] - [-sasl_username ] [-sasl_password ] - */ -static void cmd_network_add(const char *data) +static void cmd_network_add_modify(const char *data, gboolean add) { GHashTable *optlist; char *name, *value; @@ -103,15 +96,23 @@ static void cmd_network_add(const char *data) IRC_CHATNET_REC *rec; if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS, - "network add", &optlist, &name)) + "network add", &optlist, &name)) return; + if (*name == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); rec = ircnet_find(name); if (rec == NULL) { + if (!add) { + cmd_params_free(free_arg); + printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, + IRCTXT_NETWORK_NOT_FOUND, name); + return; + } + rec = g_new0(IRC_CHATNET_REC, 1); rec->name = g_strdup(name); - } else { + } else if (!add) { if (g_hash_table_lookup(optlist, "nick")) g_free_and_null(rec->nick); if (g_hash_table_lookup(optlist, "user")) g_free_and_null(rec->username); if (g_hash_table_lookup(optlist, "realname")) g_free_and_null(rec->realname); @@ -174,6 +175,30 @@ static void cmd_network_add(const char *data) cmd_params_free(free_arg); } +/* SYNTAX: NETWORK ADD [-nick ] [-user ] [-realname ] + [-host ] [-usermode ] [-autosendcmd ] + [-querychans ] [-whois ] [-msgs ] + [-kicks ] [-modes ] [-cmdspeed ] + [-cmdmax ] [-sasl_mechanism ] + [-sasl_username ] [-sasl_password ] + */ +static void cmd_network_add(const char *data) +{ + cmd_network_add_modify(data, 1); +} + +/* SYNTAX: NETWORK MODIFY [-nick ] [-user ] [-realname ] + [-host ] [-usermode ] [-autosendcmd ] + [-querychans ] [-whois ] [-msgs ] + [-kicks ] [-modes ] [-cmdspeed ] + [-cmdmax ] [-sasl_mechanism ] + [-sasl_username ] [-sasl_password ] + */ +static void cmd_network_modify(const char *data) +{ + cmd_network_add_modify(data, 0); +} + /* SYNTAX: NETWORK REMOVE */ static void cmd_network_remove(const char *data) { @@ -206,6 +231,7 @@ void fe_ircnet_init(void) command_bind("network", NULL, (SIGNAL_FUNC) cmd_network); command_bind("network list", NULL, (SIGNAL_FUNC) cmd_network_list); command_bind("network add", NULL, (SIGNAL_FUNC) cmd_network_add); + command_bind("network modify", NULL, (SIGNAL_FUNC) cmd_network_modify); command_bind("network remove", NULL, (SIGNAL_FUNC) cmd_network_remove); command_set_options("network add", "-kicks -msgs -modes -whois -cmdspeed " @@ -218,5 +244,6 @@ void fe_ircnet_deinit(void) command_unbind("network", (SIGNAL_FUNC) cmd_network); command_unbind("network list", (SIGNAL_FUNC) cmd_network_list); command_unbind("network add", (SIGNAL_FUNC) cmd_network_add); + command_unbind("network modify", (SIGNAL_FUNC) cmd_network_modify); command_unbind("network remove", (SIGNAL_FUNC) cmd_network_remove); } -- cgit v1.2.3 From 1d2113a6387d70caa399cb3311b15203d2d99fda Mon Sep 17 00:00:00 2001 From: Jari Matilainen Date: Sat, 18 Jun 2016 17:53:35 +0200 Subject: Add /server modify SYNTAX --- src/fe-common/irc/fe-irc-server.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/fe-common/irc/fe-irc-server.c b/src/fe-common/irc/fe-irc-server.c index 2cb99a2f..360fe212 100644 --- a/src/fe-common/irc/fe-irc-server.c +++ b/src/fe-common/irc/fe-irc-server.c @@ -50,12 +50,19 @@ const char *get_visible_target(IRC_SERVER_REC *server, const char *target) return target; } + /* SYNTAX: SERVER ADD [-4 | -6] [-ssl] [-ssl_cert ] [-ssl_pkey ] [-ssl_pass ] [-ssl_verify] [-ssl_cafile ] [-ssl_capath ] [-ssl_ciphers ] [-auto | -noauto] [-network ] [-host ] [-cmdspeed ] [-cmdmax ] [-port ]
[ []] */ +/* SYNTAX: SERVER MODIFY [-4 | -6] [-ssl] [-ssl_cert ] [-ssl_pkey ] [-ssl_pass ] + [-ssl_verify] [-ssl_cafile ] [-ssl_capath ] + [-ssl_ciphers ] + [-auto | -noauto] [-network ] [-host ] + [-cmdspeed ] [-cmdmax ] [-port ] +
[ []] */ /* NOTE: -network replaces the old -ircnet flag. */ static void sig_server_add_fill(IRC_SERVER_SETUP_REC *rec, GHashTable *optlist) -- cgit v1.2.3 From 054a98b0ac9bd7f828cd0878687d53e01a3438da Mon Sep 17 00:00:00 2001 From: Jari Matilainen Date: Sat, 18 Jun 2016 17:59:59 +0200 Subject: Add info about MODIFY to help files --- docs/help/in/channel.in | 2 ++ docs/help/in/network.in | 2 ++ docs/help/in/server.in | 2 ++ 3 files changed, 6 insertions(+) diff --git a/docs/help/in/channel.in b/docs/help/in/channel.in index 01bea3c1..86e824c2 100644 --- a/docs/help/in/channel.in +++ b/docs/help/in/channel.in @@ -7,6 +7,7 @@ LIST: Displays the list of configured channels. ADD: Adds a channel to your configuration. + MODIFY: Modifies a channel in your configuration. REMOVE: Removes a channel from your configuration. -auto: Automatically join the channel. @@ -36,6 +37,7 @@ /CHANNEL ADD -auto #basementcat Quakenet secret_lair /CHANNEL ADD -auto -bots '*!@*.irssi.org *!bot@irssi.org' -botcmd 'msg $0 op WzerTrzq' #hideout Freenode /CHANNEL ADD -auto -bots 'Q!TheQBot@CServe.quakenet.org' -botcmd '^MSG Q op #irssi' #irssi Quakenet + /CHANNEL MODIFY -noauto #irssi Freenode /CHANNEL REMOVE #hideout Freenode %9Special Example:%9 diff --git a/docs/help/in/network.in b/docs/help/in/network.in index 2918f6ae..ba08ef69 100644 --- a/docs/help/in/network.in +++ b/docs/help/in/network.in @@ -7,6 +7,7 @@ LIST: Displays the list of configured networks. ADD: Adds a network to your configuration. + MODIFY: Modifies a network in your configuration. REMOVE: Removes a network from your configuration. -nick: Specifies the nickname to use. @@ -59,6 +60,7 @@ /NETWORK ADD -usermode +iw -nick mike -realname 'The one and only mike!' -host staff.irssi.org Freenode /NETWORK ADD -autosendcmd '^MSG NickServ identify WzerT8zq' Freenode /NETWORK ADD -autosendcmd '^MSG Q@CServe.quakenet.org AUTH mike WzerT8zq; WAIT 2000; OPER mike WzerT8zq; WAIT 2000; MODE mike +kXP' Quakenet + /NETWORK MODIFY -usermode +gi EFnet /NETWORK REMOVE Freenode %9See also:%9 CHANNEL, CONNECT, SERVER diff --git a/docs/help/in/server.in b/docs/help/in/server.in index e407b6a9..68a62e2d 100644 --- a/docs/help/in/server.in +++ b/docs/help/in/server.in @@ -8,6 +8,7 @@ LIST: Displays the list of servers you are connected to. CONNECT: Connects to the given server. ADD: Adds a server to your configuration. + MODIFY: Modifies a server in your configuration. REMOVE: Removes a server from your configuration. PURGE: Purges the commands queued to be sent to the server. @@ -62,6 +63,7 @@ /SERVER CONNECT +chat.freenode.net /SERVER ADD -network Freenode -noautosendcmd orwell.freenode.net /SERVER ADD -! -auto -host staff.irssi.org -port 6667 -4 -network Freenode -noproxy orwell.freenode.net + /SERVER MODIFY -network Freenode -noauto orwell.freenode.net /SERVER REMOVE orwell.freenode.net 6667 Freenode /SERVER PURGE /SERVER PURGE orwell.freenode.net -- cgit v1.2.3 From 79e30405e6b22b116d9d2c8ac5af0f4a4dfdc9c7 Mon Sep 17 00:00:00 2001 From: Jari Matilainen Date: Sat, 18 Jun 2016 18:02:04 +0200 Subject: Let ADD still work as modify --- src/fe-common/core/fe-channels.c | 2 +- src/fe-common/core/fe-server.c | 2 +- src/fe-common/irc/fe-ircnet.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fe-common/core/fe-channels.c b/src/fe-common/core/fe-channels.c index fe8e4807..b79938eb 100644 --- a/src/fe-common/core/fe-channels.c +++ b/src/fe-common/core/fe-channels.c @@ -285,7 +285,7 @@ static void cmd_channel_add_modify(const char *data, gboolean add) rec = CHAT_PROTOCOL(chatnetrec)->create_channel_setup(); rec->name = g_strdup(channel); rec->chatnet = g_strdup(chatnet); - } else if (!add) { + } else { if (g_hash_table_lookup(optlist, "bots")) g_free_and_null(rec->botmasks); if (g_hash_table_lookup(optlist, "botcmd")) g_free_and_null(rec->autosendcmd); if (*password != '\0') g_free_and_null(rec->password); diff --git a/src/fe-common/core/fe-server.c b/src/fe-common/core/fe-server.c index f3792b47..e0f05980 100644 --- a/src/fe-common/core/fe-server.c +++ b/src/fe-common/core/fe-server.c @@ -138,7 +138,7 @@ static void cmd_server_add_modify(const char *data, gboolean add) } rec->address = g_strdup(addr); rec->port = port; - } else if (!add) { + } else { value = g_hash_table_lookup(optlist, "port"); if (value != NULL && *value != '\0') rec->port = atoi(value); diff --git a/src/fe-common/irc/fe-ircnet.c b/src/fe-common/irc/fe-ircnet.c index 90697bba..6778cb02 100644 --- a/src/fe-common/irc/fe-ircnet.c +++ b/src/fe-common/irc/fe-ircnet.c @@ -112,7 +112,7 @@ static void cmd_network_add_modify(const char *data, gboolean add) rec = g_new0(IRC_CHATNET_REC, 1); rec->name = g_strdup(name); - } else if (!add) { + } else { if (g_hash_table_lookup(optlist, "nick")) g_free_and_null(rec->nick); if (g_hash_table_lookup(optlist, "user")) g_free_and_null(rec->username); if (g_hash_table_lookup(optlist, "realname")) g_free_and_null(rec->realname); -- cgit v1.2.3 From 4292dbd20250faa4736ab9871bddd97dd7d6c80a Mon Sep 17 00:00:00 2001 From: Jari Matilainen Date: Sat, 18 Jun 2016 18:47:11 +0200 Subject: Add command_set_options for modify commands to allow completion --- src/fe-common/core/fe-channels.c | 1 + src/fe-common/core/fe-server.c | 1 + src/fe-common/irc/fe-ircnet.c | 2 ++ 3 files changed, 4 insertions(+) diff --git a/src/fe-common/core/fe-channels.c b/src/fe-common/core/fe-channels.c index b79938eb..dc7d1ee7 100644 --- a/src/fe-common/core/fe-channels.c +++ b/src/fe-common/core/fe-channels.c @@ -649,6 +649,7 @@ void fe_channels_init(void) command_bind("cycle", NULL, (SIGNAL_FUNC) cmd_cycle); command_set_options("channel add", "auto noauto -bots -botcmd"); + command_set_options("channel modify", "auto noauto -bots -botcmd"); command_set_options("names", "count ops halfops voices normal"); command_set_options("join", "invite window"); } diff --git a/src/fe-common/core/fe-server.c b/src/fe-common/core/fe-server.c index e0f05980..827b237e 100644 --- a/src/fe-common/core/fe-server.c +++ b/src/fe-common/core/fe-server.c @@ -410,6 +410,7 @@ void fe_server_init(void) command_bind_first("server", NULL, (SIGNAL_FUNC) server_command); command_bind_first("disconnect", NULL, (SIGNAL_FUNC) server_command); command_set_options("server add", "4 6 !! ssl +ssl_cert +ssl_pkey +ssl_pass ssl_verify +ssl_cafile +ssl_capath +ssl_ciphers auto noauto proxy noproxy -host -port noautosendcmd"); + command_set_options("server modify", "4 6 !! ssl +ssl_cert +ssl_pkey +ssl_pass ssl_verify +ssl_cafile +ssl_capath +ssl_ciphers auto noauto proxy noproxy -host -port noautosendcmd"); signal_add("server looking", (SIGNAL_FUNC) sig_server_looking); signal_add("server connecting", (SIGNAL_FUNC) sig_server_connecting); diff --git a/src/fe-common/irc/fe-ircnet.c b/src/fe-common/irc/fe-ircnet.c index 6778cb02..e82fa27f 100644 --- a/src/fe-common/irc/fe-ircnet.c +++ b/src/fe-common/irc/fe-ircnet.c @@ -236,6 +236,8 @@ void fe_ircnet_init(void) command_set_options("network add", "-kicks -msgs -modes -whois -cmdspeed " "-cmdmax -nick -user -realname -host -autosendcmd -querychans -usermode -sasl_mechanism -sasl_username -sasl_password"); + command_set_options("network modify", "-kicks -msgs -modes -whois -cmdspeed " + "-cmdmax -nick -user -realname -host -autosendcmd -querychans -usermode -sasl_mechanism -sasl_username -sasl_password"); } void fe_ircnet_deinit(void) -- cgit v1.2.3 From 2bb913f0c128dbb37737b7c2d7af99ed70801993 Mon Sep 17 00:00:00 2001 From: Jari Matilainen Date: Sun, 19 Jun 2016 16:35:13 +0200 Subject: Fix minor nits --- src/fe-common/core/fe-channels.c | 10 ++++------ src/fe-common/core/fe-server.c | 4 ++-- src/fe-common/irc/fe-irc-server.c | 18 ++++++------------ src/fe-common/irc/fe-ircnet.c | 25 +++++++++---------------- 4 files changed, 21 insertions(+), 36 deletions(-) diff --git a/src/fe-common/core/fe-channels.c b/src/fe-common/core/fe-channels.c index dc7d1ee7..2802e933 100644 --- a/src/fe-common/core/fe-channels.c +++ b/src/fe-common/core/fe-channels.c @@ -305,18 +305,16 @@ static void cmd_channel_add_modify(const char *data, gboolean add) cmd_params_free(free_arg); } -/* SYNTAX: CHANNEL ADD [-auto | -noauto] [-bots ] [-botcmd ] - [] */ +/* SYNTAX: CHANNEL ADD|MODIFY [-auto | -noauto] [-bots ] [-botcmd ] + [] */ static void cmd_channel_add(const char *data) { - cmd_channel_add_modify(data, 1); + cmd_channel_add_modify(data, TRUE); } -/* SYNTAX: CHANNEL MODIFY [-auto | -noauto] [-bots ] [-botcmd ] - [] */ static void cmd_channel_modify(const char *data) { - cmd_channel_add_modify(data, 0); + cmd_channel_add_modify(data, FALSE); } /* SYNTAX: CHANNEL REMOVE */ diff --git a/src/fe-common/core/fe-server.c b/src/fe-common/core/fe-server.c index 827b237e..d6f2841b 100644 --- a/src/fe-common/core/fe-server.c +++ b/src/fe-common/core/fe-server.c @@ -214,12 +214,12 @@ static void cmd_server_add_modify(const char *data, gboolean add) static void cmd_server_add(const char *data) { - cmd_server_add_modify(data, 1); + cmd_server_add_modify(data, TRUE); } static void cmd_server_modify(const char *data) { - cmd_server_add_modify(data, 0); + cmd_server_add_modify(data, FALSE); } /* SYNTAX: SERVER REMOVE
[] [] */ diff --git a/src/fe-common/irc/fe-irc-server.c b/src/fe-common/irc/fe-irc-server.c index 360fe212..2e22d6f2 100644 --- a/src/fe-common/irc/fe-irc-server.c +++ b/src/fe-common/irc/fe-irc-server.c @@ -51,18 +51,12 @@ const char *get_visible_target(IRC_SERVER_REC *server, const char *target) return target; } -/* SYNTAX: SERVER ADD [-4 | -6] [-ssl] [-ssl_cert ] [-ssl_pkey ] [-ssl_pass ] - [-ssl_verify] [-ssl_cafile ] [-ssl_capath ] - [-ssl_ciphers ] - [-auto | -noauto] [-network ] [-host ] - [-cmdspeed ] [-cmdmax ] [-port ] -
[ []] */ -/* SYNTAX: SERVER MODIFY [-4 | -6] [-ssl] [-ssl_cert ] [-ssl_pkey ] [-ssl_pass ] - [-ssl_verify] [-ssl_cafile ] [-ssl_capath ] - [-ssl_ciphers ] - [-auto | -noauto] [-network ] [-host ] - [-cmdspeed ] [-cmdmax ] [-port ] -
[ []] */ +/* SYNTAX: SERVER ADD|MODIFY [-4 | -6] [-ssl] [-ssl_cert ] [-ssl_pkey ] [-ssl_pass ] + [-ssl_verify] [-ssl_cafile ] [-ssl_capath ] + [-ssl_ciphers ] + [-auto | -noauto] [-network ] [-host ] + [-cmdspeed ] [-cmdmax ] [-port ] +
[ []] */ /* NOTE: -network replaces the old -ircnet flag. */ static void sig_server_add_fill(IRC_SERVER_SETUP_REC *rec, GHashTable *optlist) diff --git a/src/fe-common/irc/fe-ircnet.c b/src/fe-common/irc/fe-ircnet.c index e82fa27f..b2605379 100644 --- a/src/fe-common/irc/fe-ircnet.c +++ b/src/fe-common/irc/fe-ircnet.c @@ -175,28 +175,21 @@ static void cmd_network_add_modify(const char *data, gboolean add) cmd_params_free(free_arg); } -/* SYNTAX: NETWORK ADD [-nick ] [-user ] [-realname ] - [-host ] [-usermode ] [-autosendcmd ] - [-querychans ] [-whois ] [-msgs ] - [-kicks ] [-modes ] [-cmdspeed ] - [-cmdmax ] [-sasl_mechanism ] - [-sasl_username ] [-sasl_password ] - */ +/* SYNTAX: NETWORK ADD|MODIFY [-nick ] [-user ] [-realname ] + [-host ] [-usermode ] [-autosendcmd ] + [-querychans ] [-whois ] [-msgs ] + [-kicks ] [-modes ] [-cmdspeed ] + [-cmdmax ] [-sasl_mechanism ] + [-sasl_username ] [-sasl_password ] + */ static void cmd_network_add(const char *data) { - cmd_network_add_modify(data, 1); + cmd_network_add_modify(data, TRUE); } -/* SYNTAX: NETWORK MODIFY [-nick ] [-user ] [-realname ] - [-host ] [-usermode ] [-autosendcmd ] - [-querychans ] [-whois ] [-msgs ] - [-kicks ] [-modes ] [-cmdspeed ] - [-cmdmax ] [-sasl_mechanism ] - [-sasl_username ] [-sasl_password ] - */ static void cmd_network_modify(const char *data) { - cmd_network_add_modify(data, 0); + cmd_network_add_modify(data, FALSE); } /* SYNTAX: NETWORK REMOVE */ -- cgit v1.2.3 From a4223a3b2e5f5689c61633542f05e70c28226717 Mon Sep 17 00:00:00 2001 From: Jari Matilainen Date: Tue, 21 Jun 2016 22:05:21 +0200 Subject: use TRUE/FALSE in if statements for gboolean --- src/fe-common/core/fe-channels.c | 2 +- src/fe-common/core/fe-server.c | 2 +- src/fe-common/irc/fe-ircnet.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fe-common/core/fe-channels.c b/src/fe-common/core/fe-channels.c index 2802e933..532b1bf8 100644 --- a/src/fe-common/core/fe-channels.c +++ b/src/fe-common/core/fe-channels.c @@ -275,7 +275,7 @@ static void cmd_channel_add_modify(const char *data, gboolean add) rec = channel_setup_find(channel, chatnet); if (rec == NULL) { - if (!add) { + if (add == FALSE) { cmd_params_free(free_arg); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_CHANSETUP_NOT_FOUND, channel, chatnet); diff --git a/src/fe-common/core/fe-server.c b/src/fe-common/core/fe-server.c index d6f2841b..468cb707 100644 --- a/src/fe-common/core/fe-server.c +++ b/src/fe-common/core/fe-server.c @@ -124,7 +124,7 @@ static void cmd_server_add_modify(const char *data, gboolean add) rec = server_setup_find(addr, port, chatnet); if (rec == NULL) { - if (!add) { + if (add == FALSE) { cmd_params_free(free_arg); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_SETUPSERVER_NOT_FOUND, addr, port); diff --git a/src/fe-common/irc/fe-ircnet.c b/src/fe-common/irc/fe-ircnet.c index b2605379..b70a9ea7 100644 --- a/src/fe-common/irc/fe-ircnet.c +++ b/src/fe-common/irc/fe-ircnet.c @@ -103,7 +103,7 @@ static void cmd_network_add_modify(const char *data, gboolean add) rec = ircnet_find(name); if (rec == NULL) { - if (!add) { + if (add == FALSE) { cmd_params_free(free_arg); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_NETWORK_NOT_FOUND, name); -- cgit v1.2.3