1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-30 13:12:25 -05:00

Fixed issue 160 - Applied a patch to enable K9 to respond to addtional SEND intents

This commit is contained in:
Jesse Vincent 2009-05-02 22:30:08 +00:00
parent ab82b10918
commit 46eef4589d
2 changed files with 66 additions and 2 deletions

View File

@ -132,6 +132,16 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<data android:mimeType="text/plain" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<data android:mimeType="message/*" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="mailto" />

View File

@ -389,8 +389,62 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
addAttachment(stream);
}
}
}
else {
/*
* There might be an EXTRA_SUBJECT, EXTRA_TEXT, EXTRA_EMAIL, EXTRA_BCC or EXTRA_CC
*/
String extraSubject = intent.getStringExtra(Intent.EXTRA_SUBJECT);
String extraText = intent.getStringExtra(Intent.EXTRA_TEXT);
String[] extraEmail = intent.getStringArrayExtra(Intent.EXTRA_EMAIL);
String[] extraBcc = intent.getStringArrayExtra(Intent.EXTRA_BCC);
String[] extraCc = intent.getStringArrayExtra(Intent.EXTRA_CC);
String addressList = new String();
// Cache array size, as per Google's recommendations.
int arraySize;
int i;
mSubjectView.setText(extraSubject);
mMessageContentView.setText(extraText);
if (extraEmail != null){
arraySize = extraEmail.length;
if (arraySize > 1){
for (i=0; i < (arraySize-1); i++) {
addressList += extraEmail[i]+", ";
}
addressList += extraEmail[arraySize-1];
}
}
mToView.setText(addressList);
addressList = "";
if (extraBcc != null){
arraySize = extraBcc.length;
if (arraySize > 1){
for (i=0; i < (arraySize-1); i++) {
addressList += extraBcc[i]+", ";
}
addressList += extraBcc[arraySize-1];
}
}
mBccView.setText(addressList);
addressList = "";
if (extraCc != null){
arraySize = extraCc.length;
if (arraySize > 1){
for (i=0; i < (arraySize-1); i++) {
addressList += extraCc[i]+", ";
}
addressList += extraCc[arraySize-1];
}
}
mCcView.setText(addressList);
addressList = "";
} else {
mAccount = (Account) intent.getSerializableExtra(EXTRA_ACCOUNT);
mFolder = (String) intent.getStringExtra(EXTRA_FOLDER);
mSourceMessageUid = (String) intent.getStringExtra(EXTRA_MESSAGE);