if (account.getLastReceiveTimestamp() == 0) {
logger.warn("The Signal protocol expects that incoming messages are regularly received.");
} else {
- var diffInMilliseconds = new Date().getTime() - account.getLastReceiveTimestamp();
+ var diffInMilliseconds = System.currentTimeMillis() - account.getLastReceiveTimestamp();
long days = TimeUnit.DAYS.convert(diffInMilliseconds, TimeUnit.MILLISECONDS);
if (days > 7) {
logger.warn(
) {
var profile = account.getProfileStore().getProfile(recipientId);
- var now = new Date().getTime();
+ var now = System.currentTimeMillis();
// Profiles are cached for 24h before retrieving them again, unless forced
if (!force && profile != null && now - profile.getLastUpdateTimestamp() < 24 * 60 * 60 * 1000) {
return profile;
var profileKey = account.getProfileStore().getProfileKey(recipientId);
if (profileKey == null) {
- profile = new Profile(new Date().getTime(),
+ profile = new Profile(System.currentTimeMillis(),
null,
null,
null,
SignalServiceContent content = null;
Exception exception = null;
final CachedMessage[] cachedMessage = {null};
- account.setLastReceiveTimestamp(new Date().getTime());
+ account.setLastReceiveTimestamp(System.currentTimeMillis());
try {
var result = messagePipe.readOrEmpty(timeout, unit, envelope1 -> {
final var recipientId = envelope1.hasSource()
import java.nio.file.Files;
import java.util.Arrays;
import java.util.Collections;
-import java.util.Date;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
}
public CachedMessage cacheMessage(SignalServiceEnvelope envelope, RecipientId recipientId) {
- final var now = new Date().getTime();
+ final var now = System.currentTimeMillis();
try {
var cacheFile = getMessageCacheFile(recipientId, now, envelope.getTimestamp());
import org.whispersystems.signalservice.api.profiles.SignalServiceProfile;
import java.util.Base64;
-import java.util.Date;
import java.util.HashSet;
public class ProfileUtils {
var aboutEmoji = decrypt(encryptedProfile.getAboutEmoji(), profileCipher);
final var nameParts = splitName(name);
- return new Profile(new Date().getTime(),
+ return new Profile(System.currentTimeMillis(),
nameParts.first(),
nameParts.second(),
about,