mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Small improvements
This commit is contained in:
parent
e376c33261
commit
ceb00f7d91
3 changed files with 6 additions and 3 deletions
|
@ -87,7 +87,7 @@ public class ActivityCompose extends ActivityBase implements FragmentManager.OnB
|
|||
args.putLong("account", -1);
|
||||
|
||||
Uri uri = intent.getData();
|
||||
if (uri != null && "mailto".equals(uri.getScheme())) {
|
||||
if (uri != null && "mailto".equalsIgnoreCase(uri.getScheme())) {
|
||||
// https://www.ietf.org/rfc/rfc2368.txt
|
||||
MailTo mailto = MailTo.parse(uri.toString());
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ import android.net.ParseException;
|
|||
import android.net.Uri;
|
||||
import android.util.Pair;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.net.MailTo;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -41,8 +42,8 @@ public class IPInfo {
|
|||
|
||||
private final static int FETCH_TIMEOUT = 15 * 1000; // milliseconds
|
||||
|
||||
static Pair<String, Organization> getOrganization(Uri uri, Context context) throws IOException, ParseException {
|
||||
if ("mailto".equals(uri.getScheme())) {
|
||||
static Pair<String, Organization> getOrganization(@NonNull Uri uri, Context context) throws IOException, ParseException {
|
||||
if ("mailto".equalsIgnoreCase(uri.getScheme())) {
|
||||
MailTo email = MailTo.parse(uri.toString());
|
||||
String to = email.getTo();
|
||||
if (to == null || !to.contains("@"))
|
||||
|
|
|
@ -1282,6 +1282,8 @@ public class MessageHelper {
|
|||
String unsubscribe = entry.substring(lt + 1, gt);
|
||||
Uri uri = Uri.parse(unsubscribe);
|
||||
String scheme = uri.getScheme();
|
||||
if (scheme != null)
|
||||
scheme = scheme.toLowerCase(Locale.ROOT);
|
||||
if (mailto == null && "mailto".equals(scheme))
|
||||
mailto = unsubscribe;
|
||||
if (link == null && ("http".equals(scheme) || "https".equals(scheme)))
|
||||
|
|
Loading…
Reference in a new issue