~singpolyma/cheogram-android

0d8314cd4e446781987753ac34c6509b57a006cc — Stephen Paul Weber a month ago bb7be5a
Default action if there are none

Spec says that actions must be specified if there are any.  In practise, at
least biboumi violates this and sends back no actions at all but is in
"executing" state meaning it expects a next stage.  So in this case we should do
something smarter than assuming we're all done.  Put up a button for the
execute/default action.
M src/cheogram/res/values/strings.xml => src/cheogram/res/values/strings.xml +1 -0
@@ 18,4 18,5 @@
    <string name="action_prev">Back</string>
    <string name="action_complete">Finish</string>
    <string name="action_close">Close</string>
    <string name="action_execute">Go</string>
</resources>

M src/main/java/eu/siacs/conversations/entities/Conversation.java => src/main/java/eu/siacs/conversations/entities/Conversation.java +6 -0
@@ 1778,6 1778,12 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
                        removeSession(this);
                        return;
                    }

                    if (command.getAttribute("status").equals("executing") && actionsAdapter.getCount() < 1) {
                        // No actions have been given, but we are not done?
                        // This is probably a spec violation, but we should do *something*
                        actionsAdapter.add("execute");
                    }
                }

                if (actionsAdapter.getCount() > 0) {