~singpolyma/cheogram-android

276c253e67b4bfcc7a21a0b6a9a4a1b84d2b4fb4 — Stephen Paul Weber 3 months ago e78f8d3
Allow adding the "Go" button even if there is only one fillable field
1 files changed, 3 insertions(+), 1 deletions(-)

M src/main/java/eu/siacs/conversations/entities/Conversation.java
M src/main/java/eu/siacs/conversations/entities/Conversation.java => src/main/java/eu/siacs/conversations/entities/Conversation.java +3 -1
@@ 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"));