From 9ca688b35f04eaa77e5e68e8181b4f398a85a8bc Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 20 Mar 2020 11:06:27 +0100 Subject: [PATCH] Use subject for conversation actrions --- .../eu/faircode/email/AdapterMessage.java | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 4dc88baecb..d69cae3d55 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -2054,6 +2054,17 @@ public class AdapterMessage extends RecyclerView.Adapter input = new ArrayList<>(); + if (!TextUtils.isEmpty(message.subject)) + input.add(new ConversationActions.Message.Builder(person) + .setReferenceTime(dt) + .setText(message.subject) + .build()); + input.add(new ConversationActions.Message.Builder(person) + .setReferenceTime(dt) + .setText(document.text()) + .build()); + Set included = Collections.unmodifiableSet( new HashSet<>(Arrays.asList( ConversationAction.TYPE_TEXT_REPLY @@ -2063,14 +2074,6 @@ public class AdapterMessage extends RecyclerView.Adapter hints = Collections.unmodifiableList(Arrays.asList( - ConversationActions.Request.HINT_FOR_IN_APP - )); - ConversationActions.Message cmessage = - new ConversationActions.Message.Builder(person) - .setReferenceTime(dt) - .setText(document.text()) - .build(); TextClassifier.EntityConfig config = new TextClassifier.EntityConfig.Builder() //.setIncludedTypes(included) @@ -2078,8 +2081,13 @@ public class AdapterMessage extends RecyclerView.Adapter hints = Collections.unmodifiableList(Arrays.asList( + ConversationActions.Request.HINT_FOR_IN_APP + )); + ConversationActions.Request crequest = - new ConversationActions.Request.Builder(Arrays.asList(cmessage)) + new ConversationActions.Request.Builder(input) .setTypeConfig(config) .setHints(hints) .build();