mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-06 09:03:56 +02:00
Select identity by canonical address
This commit is contained in:
@@ -21,6 +21,7 @@ package eu.faircode.email;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.View;
|
||||
@@ -129,4 +130,11 @@ public class Helper {
|
||||
static Address myAddress() throws UnsupportedEncodingException {
|
||||
return new InternetAddress("marcel+fairemail@faircode.eu", "FairCode");
|
||||
}
|
||||
|
||||
static String canonicalAddress(String address) {
|
||||
String[] a = address.split("\\@");
|
||||
if (a.length > 0)
|
||||
a[0] = a[0].split("\\+")[0];
|
||||
return TextUtils.join("@", a);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user