mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-03 21:32:19 +00:00
Move more system contact info into recipient database
1) Move contact URI, contact photo URI, and custom label into recipient database, so there are no longer any contact DB queries during Recipient object loading. 2) Use a SoftHashMap so that any referenced Recipient objects can't get kicked out of the cache. 3) Don't load Recipient objects through the provider during sync. This was a super expensive thing to do, and blew up the cache. 4) Only apply changes to Recipient objects during sync if they are in the cache. Otherwise, there should be no outstanding references, and the changes are fine going exclusively to the DB.
This commit is contained in:
@@ -5,7 +5,6 @@ import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import org.thoughtcrime.securesms.contacts.avatars.ProfileContactPhoto;
|
||||
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||
import org.thoughtcrime.securesms.database.RecipientDatabase;
|
||||
import org.thoughtcrime.securesms.dependencies.InjectableType;
|
||||
@@ -83,10 +82,6 @@ public class RetrieveProfileAvatarJob extends ContextJob implements InjectableTy
|
||||
}
|
||||
|
||||
database.setProfileAvatar(recipient, profileAvatar);
|
||||
|
||||
if (recipient.resolve().getContactPhoto() == null) {
|
||||
recipient.setContactPhoto(new ProfileContactPhoto(recipient.getAddress(), profileAvatar));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user