Convert Recipient to kotlin.

This commit is contained in:
Greyson Parrelli
2024-04-03 12:23:55 -04:00
parent b50eab230d
commit 3ba2b46bb0
100 changed files with 1513 additions and 2020 deletions

View File

@@ -168,7 +168,7 @@ public final class AvatarUtil {
.diskCacheStrategy(DiskCacheStrategy.ALL)
.override(size);
if (recipient.shouldBlurAvatar()) {
if (recipient.getShouldBlurAvatar()) {
BlurTransformation blur = new BlurTransformation(context, 0.25f, BlurTransformation.MAX_RADIUS);
if (transformation != null) {
return request.transform(blur, transformation);

View File

@@ -437,7 +437,7 @@ public class CommunicationActions {
SimpleTask.run(() -> {
Recipient recipient = Recipient.external(activity, e164);
if (!recipient.isRegistered() || !recipient.hasServiceId()) {
if (!recipient.isRegistered() || !recipient.getHasServiceId()) {
try {
ContactDiscovery.refresh(activity, recipient, false, TimeUnit.SECONDS.toMillis(10));
recipient = Recipient.resolved(recipient.getId());
@@ -450,7 +450,7 @@ public class CommunicationActions {
}, recipient -> {
dialog.dismiss();
if (recipient.isRegistered() && recipient.hasServiceId()) {
if (recipient.isRegistered() && recipient.getHasServiceId()) {
startConversation(activity, recipient, null);
} else {
new MaterialAlertDialogBuilder(activity)
@@ -481,7 +481,7 @@ public class CommunicationActions {
}, recipient -> {
dialog.dismiss();
if (recipient != null && recipient.isRegistered() && recipient.hasServiceId()) {
if (recipient != null && recipient.isRegistered() && recipient.getHasServiceId()) {
startConversation(activity, recipient, null);
} else {
new MaterialAlertDialogBuilder(activity)

View File

@@ -89,6 +89,6 @@ object MessageConstraintsUtil {
}
private fun isSelf(recipientId: RecipientId): Boolean {
return Recipient.isSelfSet() && Recipient.self().id == recipientId
return Recipient.isSelfSet && Recipient.self().id == recipientId
}
}

View File

@@ -392,7 +392,7 @@ public final class ProfileUtil {
private static @NonNull SignalServiceAddress toSignalServiceAddress(@NonNull Context context, @NonNull Recipient recipient) throws IOException {
if (recipient.getRegistered() == RecipientTable.RegisteredState.NOT_REGISTERED) {
if (recipient.hasServiceId()) {
if (recipient.getHasServiceId()) {
return new SignalServiceAddress(recipient.requireServiceId(), recipient.getE164().orElse(null));
} else {
throw new IOException(recipient.getId() + " not registered!");

View File

@@ -13,13 +13,13 @@ class RecipientAccessList(private val recipients: List<Recipient>) : List<Recipi
private val byServiceId: Map<ServiceId, Recipient> by lazy {
recipients
.filter { it.hasServiceId() }
.filter { it.hasServiceId }
.associateBy { it.requireServiceId() }
}
private val byE164: Map<String, Recipient> by lazy {
recipients
.filter { it.hasE164() }
.filter { it.hasE164 }
.associateBy { it.requireE164() }
}