mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-31 22:26:06 +02:00
Attach autocrypt public key
This commit is contained in:
@@ -236,9 +236,11 @@ public class MessageHelper {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
try (BufferedReader br = new BufferedReader(new FileReader(file))) {
|
||||
String line;
|
||||
while ((line = br.readLine()) != null)
|
||||
while ((line = br.readLine()) != null) {
|
||||
Log.i(line);
|
||||
if (!line.startsWith("-----") && !line.endsWith("-----"))
|
||||
sb.append(line);
|
||||
}
|
||||
}
|
||||
|
||||
imessage.addHeader("Autocrypt",
|
||||
@@ -876,6 +878,20 @@ public class MessageHelper {
|
||||
}
|
||||
}
|
||||
|
||||
String getAutocrypt() throws MessagingException {
|
||||
String autocrypt = imessage.getHeader("Autocrypt", null);
|
||||
if (autocrypt == null)
|
||||
return null;
|
||||
|
||||
autocrypt = MimeUtility.unfold(autocrypt);
|
||||
|
||||
int k = autocrypt.indexOf("keydata=");
|
||||
if (k < 0)
|
||||
return null;
|
||||
|
||||
return autocrypt.substring(k + 8);
|
||||
}
|
||||
|
||||
String getSubject() throws MessagingException {
|
||||
String subject = imessage.getHeader("Subject", null);
|
||||
if (subject == null)
|
||||
|
||||
Reference in New Issue
Block a user