emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master bda31b2c6d6: Properly merge EXTRA_EMAIL content with mailto URIs


From: Po Lu
Subject: master bda31b2c6d6: Properly merge EXTRA_EMAIL content with mailto URIs
Date: Mon, 13 Nov 2023 21:57:31 -0500 (EST)

branch: master
commit bda31b2c6d62652c742e800b692dffd926f8284b
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Properly merge EXTRA_EMAIL content with mailto URIs
    
    * java/org/gnu/emacs/EmacsOpenActivity.java (onCreate):
    EXTRA_EMAIL is an array rather than a string, so insert
    its first element into an empty mailto URI.
---
 java/org/gnu/emacs/EmacsOpenActivity.java | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/java/org/gnu/emacs/EmacsOpenActivity.java 
b/java/org/gnu/emacs/EmacsOpenActivity.java
index a5e8be2f238..5cca6cfcdff 100644
--- a/java/org/gnu/emacs/EmacsOpenActivity.java
+++ b/java/org/gnu/emacs/EmacsOpenActivity.java
@@ -414,6 +414,7 @@ public final class EmacsOpenActivity extends Activity
     String subjectString, textString, attachmentString;
     CharSequence tem;
     String tem1;
+    String[] emails;
     StringBuilder builder;
     List<Parcelable> list;
 
@@ -466,16 +467,16 @@ public final class EmacsOpenActivity extends Activity
            /* If fileName is merely mailto: (absent either an email
               address or content), then the program launching Emacs
               conceivably provided such an URI to exclude non-email
-              programs from being enumerated within the Share dialog;
-              whereupon Emacs should replace it with any address
-              provided as EXTRA_EMAIL.  */
+              programs from the Share dialog.  Intents created thus
+              might hold the recipient email as a string array, which
+              is non-standard behavior.  */
 
            if (fileName.equals ("mailto:";) || fileName.equals ("mailto://";))
              {
-               tem = intent.getCharSequenceExtra (Intent.EXTRA_EMAIL);
+               emails = intent.getStringArrayExtra (Intent.EXTRA_EMAIL);
 
-               if (tem != null)
-                 fileName = "mailto:"; + tem;
+               if (emails[0] != null && emails.length > 0)
+                 fileName = "mailto:"; + emails[0];
              }
 
            /* Subsequently, escape fileName such that it is rendered



reply via email to

[Prev in Thread] Current Thread [Next in Thread]