From d0871411c5ce4c4bd51719230985bf808f8d1e92 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 21 Jun 2022 13:42:20 -0500 Subject: [PATCH] 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. --- src/cheogram/res/values/strings.xml | 1 + .../java/eu/siacs/conversations/entities/Conversation.java | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/cheogram/res/values/strings.xml b/src/cheogram/res/values/strings.xml index bc35884e59447bf7e5e1e97047d38510e84e5033..23cb914f544bbdcdfed2287eb1bfe7a7631fa364 100644 --- a/src/cheogram/res/values/strings.xml +++ b/src/cheogram/res/values/strings.xml @@ -18,4 +18,5 @@ Back Finish Close + Go diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java index cc9ff1a10146f34f5b5e48be63367dd88284edae..8a09d45fc4875987b234e80a6e88f0dcb79f6aa7 100644 --- a/src/main/java/eu/siacs/conversations/entities/Conversation.java +++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java @@ -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) {