From 276c253e67b4bfcc7a21a0b6a9a4a1b84d2b4fb4 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Mon, 13 Feb 2023 09:42:36 -0500 Subject: [PATCH] Allow adding the "Go" button even if there is only one fillable field --- .../java/eu/siacs/conversations/entities/Conversation.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java index ac654179c..37bfb1529 100644 --- a/src/main/java/eu/siacs/conversations/entities/Conversation.java +++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java @@ -2329,6 +2329,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl this.actionsAdapter.clear(); layoutManager.setSpanCount(1); + boolean actionsCleared = false; Element command = iq.findChild("command", "http://jabber.org/protocol/commands"); if (iq.getType() == IqPacket.TYPE.RESULT && command != null) { if (mNode.equals("jabber:iq:register") && command.getAttribute("status").equals("completed")) { @@ -2378,6 +2379,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl } if (fillableFieldCount == 1 && actionsAdapter.countExceptCancel() < 2 && fillableFieldType != null && (fillableFieldType.equals("list-single") || (fillableFieldType.equals("boolean") && fillableFieldValue == null))) { + actionsCleared = true; actionsAdapter.clearExceptCancel(); } break; @@ -2403,7 +2405,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl return; } - if (command.getAttribute("status").equals("executing") && actionsAdapter.countExceptCancel() < 1 && fillableFieldCount > 1) { + if (command.getAttribute("status").equals("executing") && actionsAdapter.countExceptCancel() < 1 && !actionsCleared) { // No actions have been given, but we are not done? // This is probably a spec violation, but we should do *something* actionsAdapter.add(Pair.create("execute", "execute")); -- 2.38.5