From 38978b153b1f9a9c155382077c5c7034e6f23525 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Thu, 5 Nov 2020 09:34:56 +0100 Subject: [PATCH] Simplify _lastactivity_autocomplete() --- src/command/cmd_ac.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c index 80abcf36..31156e15 100644 --- a/src/command/cmd_ac.c +++ b/src/command/cmd_ac.c @@ -4148,7 +4148,7 @@ _lastactivity_autocomplete(ProfWin* window, const char* const input, gboolean pr char* result = NULL; result = autocomplete_param_with_ac(input, "/lastactivity", status_ac, TRUE, previous); - if (result) { + if (!result) { return result; } @@ -4157,15 +4157,10 @@ _lastactivity_autocomplete(ProfWin* window, const char* const input, gboolean pr if (conn_status == JABBER_CONNECTED) { result = autocomplete_param_with_func(input, "/lastactivity set", prefs_autocomplete_boolean_choice, previous, NULL); - if (result) { - return result; - } - - result = autocomplete_param_with_func(input, "/lastactivity get", roster_barejid_autocomplete, previous, NULL); - if (result) { - return result; + if (!result) { + result = autocomplete_param_with_func(input, "/lastactivity get", roster_barejid_autocomplete, previous, NULL); } } - return NULL; + return result; }