Fix missing avatar by force downloading if file is missing.

This commit is contained in:
Cody Henthorne
2025-02-18 10:41:19 -05:00
committed by Greyson Parrelli
parent 9836185590
commit d3ff6ba3d2

View File

@@ -95,12 +95,12 @@ public class RetrieveProfileAvatarJob extends BaseJob {
return;
}
if (forceUpdate) {
ProfileAvatarFileDetails details = recipient.getProfileAvatarFileDetails();
if (!details.hasFile() || (details.getLastModified() > System.currentTimeMillis() || details.getLastModified() + MIN_TIME_BETWEEN_FORCE_RETRY < System.currentTimeMillis())) {
Log.i(TAG, "Forcing re-download of avatar.");
ProfileAvatarFileDetails details = recipient.getProfileAvatarFileDetails();
if (!details.hasFile() || forceUpdate) {
if (details.getLastModified() > System.currentTimeMillis() || details.getLastModified() + MIN_TIME_BETWEEN_FORCE_RETRY < System.currentTimeMillis()) {
Log.i(TAG, "Forcing re-download of avatar. hasFile: " + details.hasFile());
} else {
Log.i(TAG, "Too early to force re-download avatar.");
Log.i(TAG, "Too early to force re-download avatar. hasFile: " + details.hasFile());
return;
}
} else if (profileAvatar != null && profileAvatar.equals(recipient.resolve().getProfileAvatar())) {