Update message hash

This commit is contained in:
M66B
2020-04-01 12:50:15 +02:00
parent 8dcd2244b0
commit 5a1f2b4fdf
2 changed files with 17 additions and 7 deletions

View File

@@ -52,6 +52,7 @@ import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -1182,6 +1183,15 @@ public class MessageHelper {
return sb.toString();
}
String getHash() throws MessagingException {
try {
return Helper.sha1(getHeaders().getBytes());
} catch (NoSuchAlgorithmException ex) {
Log.e(ex);
return null;
}
}
static String formatAddresses(Address[] addresses) {
return formatAddresses(addresses, true, false);
}