1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-24 08:38:51 -05:00

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

This commit is contained in:
cketti 2011-02-13 05:23:18 +01:00
parent ae2c933181
commit 44d2194a00
2 changed files with 16 additions and 0 deletions

View File

@ -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";
}
}
/**

View File

@ -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++) {