Remove avatar color from CallLink table.

This commit is contained in:
Alex Hart
2023-06-14 14:58:04 -03:00
committed by Cody Henthorne
parent b9835584d8
commit 51222738df
22 changed files with 115 additions and 96 deletions

View File

@@ -13,6 +13,7 @@ import com.annimon.stream.Stream;
import org.signal.core.util.ThreadUtil;
import org.signal.core.util.logging.Log;
import org.thoughtcrime.securesms.conversation.colors.AvatarColor;
import org.thoughtcrime.securesms.database.CallLinkTable;
import org.thoughtcrime.securesms.database.DistributionListTables;
import org.thoughtcrime.securesms.database.GroupTable;
@@ -219,10 +220,10 @@ public final class LiveRecipient {
avatarId = Optional.of(groupRecord.get().getAvatarId());
}
return new RecipientDetails(title, null, avatarId, false, false, record.getRegistered(), record, members, false, groupRecord.get().isActive());
return new RecipientDetails(title, null, avatarId, false, false, record.getRegistered(), record, members, false, groupRecord.get().isActive(), null);
}
return new RecipientDetails(null, null, Optional.empty(), false, false, record.getRegistered(), record, null, false, false);
return new RecipientDetails(null, null, Optional.empty(), false, false, record.getRegistered(), record, null, false, false, null);
}
@WorkerThread
@@ -247,10 +248,10 @@ public final class LiveRecipient {
if (callLink != null) {
String name = callLink.getState().getName();
return RecipientDetails.forCallLink(name, record);
return RecipientDetails.forCallLink(name, record, callLink.getAvatarColor());
}
return RecipientDetails.forCallLink(null, record);
return RecipientDetails.forCallLink(null, record, AvatarColor.UNKNOWN);
}
synchronized void set(@NonNull Recipient recipient) {

View File

@@ -98,7 +98,8 @@ public class RecipientDetails {
@NonNull RecipientRecord record,
@Nullable List<RecipientId> participantIds,
boolean isReleaseChannel,
boolean isActiveGroup)
boolean isActiveGroup,
@Nullable AvatarColor avatarColor)
{
this.groupAvatarId = groupAvatarId;
this.systemContactPhoto = Util.uri(record.getSystemContactPhotoUri());
@@ -141,7 +142,7 @@ public class RecipientDetails {
this.mentionSetting = record.getMentionSetting();
this.wallpaper = record.getWallpaper();
this.chatColors = record.getChatColors();
this.avatarColor = record.getAvatarColor();
this.avatarColor = avatarColor != null ? avatarColor : record.getAvatarColor();
this.about = record.getAbout();
this.aboutEmoji = record.getAboutEmoji();
this.systemProfileName = record.getSystemProfileName();
@@ -227,15 +228,15 @@ public class RecipientDetails {
}
}
return new RecipientDetails(null, settings.getSystemDisplayName(), Optional.empty(), systemContact, isSelf, registeredState, settings, null, isReleaseChannel, false);
return new RecipientDetails(null, settings.getSystemDisplayName(), Optional.empty(), systemContact, isSelf, registeredState, settings, null, isReleaseChannel, false, null);
}
public static @NonNull RecipientDetails forDistributionList(String title, @Nullable List<RecipientId> members, @NonNull RecipientRecord record) {
return new RecipientDetails(title, null, Optional.empty(), false, false, record.getRegistered(), record, members, false, false);
return new RecipientDetails(title, null, Optional.empty(), false, false, record.getRegistered(), record, members, false, false, null);
}
public static @NonNull RecipientDetails forCallLink(String name, @NonNull RecipientRecord record) {
return new RecipientDetails(name, null, Optional.empty(), false, false, record.getRegistered(), record, Collections.emptyList(), false, false);
public static @NonNull RecipientDetails forCallLink(String name, @NonNull RecipientRecord record, @NonNull AvatarColor avatarColor) {
return new RecipientDetails(name, null, Optional.empty(), false, false, record.getRegistered(), record, Collections.emptyList(), false, false, avatarColor);
}
public static @NonNull RecipientDetails forUnknown() {