From 4943cc5e58f0b26b20c69f6d36856e05afc6d623 Mon Sep 17 00:00:00 2001 From: Ailin Nemui Date: Mon, 27 Sep 2021 22:19:43 +0200 Subject: [PATCH] fix /server modify port argument order --- src/fe-common/core/fe-server.c | 10 +++++----- src/fe-common/core/module-formats.c | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/fe-common/core/fe-server.c b/src/fe-common/core/fe-server.c index 78e7202c..4a52cc3c 100644 --- a/src/fe-common/core/fe-server.c +++ b/src/fe-common/core/fe-server.c @@ -124,17 +124,17 @@ static void cmd_server_add_modify(const char *data, gboolean add) port = old_port = -1; - if (*portstr != '\0') - port = add_port = atoi(portstr); + value = g_hash_table_lookup(optlist, "port"); + if (value != NULL && *value != '\0') + port = add_port = atoi(value); else if (g_hash_table_lookup(optlist, "tls") || g_hash_table_lookup(optlist, "ssl")) add_port = DEFAULT_SERVER_ADD_TLS_PORT; else add_port = DEFAULT_SERVER_ADD_PORT; - value = g_hash_table_lookup(optlist, "port"); - if (value != NULL && *value != '\0') - old_port = atoi(value); + if (*portstr != '\0') + old_port = atoi(portstr); chatnet = g_hash_table_lookup(optlist, "network"); diff --git a/src/fe-common/core/module-formats.c b/src/fe-common/core/module-formats.c index 0319ee11..faea034a 100644 --- a/src/fe-common/core/module-formats.c +++ b/src/fe-common/core/module-formats.c @@ -22,6 +22,7 @@ #include FORMAT_REC fecommon_core_formats[] = { + /* clang-format off */ { MODULE_NAME, "Core", 0 }, /* ---- */ @@ -88,7 +89,7 @@ FORMAT_REC fecommon_core_formats[] = { { "server_reconnect_not_found", "Reconnection tag {server $0} not found", 1, { 0 } }, { "setupserver_added", "Server {server $0} saved", 2, { 0, 1 } }, { "setupserver_removed", "Server {server $0} removed", 2, { 0, 1 } }, - { "setupserver_not_found", "Server {server $0} not found", 2, { 0, 1 } }, + { "setupserver_not_found", "Server {server $0} {hilight $1} not found", 2, { 0, 1 } }, { "your_nick", "Your nickname is {nick $0}", 1, { 0 } }, /* ---- */ @@ -316,4 +317,5 @@ FORMAT_REC fecommon_core_formats[] = { { "tls_protocol_version", "Protocol: {hilight $0} ({hilight $1} bit, {hilight $2})", 3, { 0, 1, 0 } }, { NULL, NULL, 0 } + /* clang-format on */ };