mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 09:49:30 +01:00
Convert Recipient to kotlin.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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!");
|
||||
|
||||
@@ -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() }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user