about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-11-05 09:34:56 +0100
committerMichael Vetter <jubalh@iodoru.org>2020-11-05 09:34:56 +0100
commit38978b153b1f9a9c155382077c5c7034e6f23525 (patch)
tree6968b9a4f3471c0a1892cfc3dfcb417fbf2cce42 /src
parent23e9d23a3e649ee9ce0d14b491b58a33a4864e3e (diff)
downloadprofani-tty-38978b153b1f9a9c155382077c5c7034e6f23525.tar.gz
Simplify _lastactivity_autocomplete()
Diffstat (limited to 'src')
-rw-r--r--src/command/cmd_ac.c13
1 files 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;
 }