Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 44d2194a authored by cketti's avatar cketti
Browse files

Add extra for the sender address(es) to the "Share intent"

parent ae2c9331
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -293,6 +293,14 @@ public class K9 extends Application {
            public static final String EXTRA_FROM_SELF          = "com.fsck.k9.intent.extra.FROM_SELF";
        }

        public static class Share {
            /*
             * We don't want to use EmailReceived.EXTRA_FROM ("com.fsck.k9.intent.extra.FROM")
             * because of different semantics (String array vs. string with comma separated
             * email addresses)
             */
            public static final String EXTRA_FROM               = "com.fsck.k9.intent.extra.SENDER";
        }
    }

    /**
+8 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import com.fsck.k9.NotificationSetting;
import com.fsck.k9.Preferences;
import com.fsck.k9.R;
import com.fsck.k9.SearchSpecification;
import com.fsck.k9.K9.Intents;
import com.fsck.k9.activity.FolderList;
import com.fsck.k9.activity.MessageList;
import com.fsck.k9.helper.Utility;
@@ -3478,6 +3479,13 @@ public class MessagingController implements Runnable {
                    }
                    msg.putExtra(Intent.EXTRA_SUBJECT, message.getSubject());

                    Address[] from = message.getFrom();
                    String[] senders = new String[from.length];
                    for (int i = 0; i < from.length; i++) {
                        senders[i] = from[i].toString();
                    }
                    msg.putExtra(Intents.Share.EXTRA_FROM, senders);

                    Address[] to = message.getRecipients(RecipientType.TO);
                    String[] recipientsTo = new String[to.length];
                    for (int i = 0; i < to.length; i++) {