mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Convert Recipient to kotlin.
This commit is contained in:
@@ -154,7 +154,7 @@ final class GroupManagerV1 {
|
||||
|
||||
for (RecipientId member : members) {
|
||||
Recipient recipient = Recipient.resolved(member);
|
||||
if (recipient.hasE164()) {
|
||||
if (recipient.getHasE164()) {
|
||||
e164Members.add(recipient.requireE164());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,6 @@ public final class GroupsV2CapabilityChecker {
|
||||
static boolean allHaveServiceId(@NonNull Collection<RecipientId> recipientIds) {
|
||||
return Recipient.resolvedList(recipientIds)
|
||||
.stream()
|
||||
.allMatch(Recipient::hasServiceId);
|
||||
.allMatch(Recipient::getHasServiceId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ public class AddMembersActivity extends PushContactSelectionActivity implements
|
||||
|
||||
@Override
|
||||
public void onBeforeContactSelected(boolean isFromUnknownSearchKey, @NonNull Optional<RecipientId> recipientId, String number, @NonNull Consumer<Boolean> callback) {
|
||||
if (getGroupId().isV1() && recipientId.isPresent() && !Recipient.resolved(recipientId.get()).hasE164()) {
|
||||
if (getGroupId().isV1() && recipientId.isPresent() && !Recipient.resolved(recipientId.get()).getHasE164()) {
|
||||
Toast.makeText(this, R.string.AddMembersActivity__this_person_cant_be_added_to_legacy_groups, Toast.LENGTH_SHORT).show();
|
||||
callback.accept(false);
|
||||
return;
|
||||
|
||||
@@ -50,7 +50,7 @@ public final class AddToGroupViewModel extends ViewModel {
|
||||
String recipientName = recipient.getDisplayName(context);
|
||||
String groupName = groupRecipient.getDisplayName(context);
|
||||
|
||||
if (groupRecipient.getGroupId().get().isV1() && !recipient.hasE164()) {
|
||||
if (groupRecipient.getGroupId().get().isV1() && !recipient.getHasE164()) {
|
||||
events.postValue(new Event.LegacyGroupDenialEvent());
|
||||
} else {
|
||||
events.postValue(new Event.AddToSingleGroupConfirmationEvent(context.getResources().getString(R.string.AddToGroupActivity_add_member),
|
||||
|
||||
@@ -202,7 +202,7 @@ public class CreateGroupActivity extends ContactSelectionActivity implements Con
|
||||
stopwatch.split("resolve");
|
||||
|
||||
Set<Recipient> registeredChecks = resolved.stream()
|
||||
.filter(r -> !r.isRegistered() || !r.hasServiceId())
|
||||
.filter(r -> !r.isRegistered() || !r.getHasServiceId())
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
Log.i(TAG, "Need to do " + registeredChecks.size() + " registration checks.");
|
||||
@@ -222,7 +222,7 @@ public class CreateGroupActivity extends ContactSelectionActivity implements Con
|
||||
dismissibleDialog.dismiss();
|
||||
stopwatch.stop(TAG);
|
||||
|
||||
List<Recipient> notRegistered = recipients.stream().filter(r -> !r.isRegistered() || !r.hasServiceId()).collect(Collectors.toList());
|
||||
List<Recipient> notRegistered = recipients.stream().filter(r -> !r.isRegistered() || !r.getHasServiceId()).collect(Collectors.toList());
|
||||
|
||||
if (notRegistered.isEmpty()) {
|
||||
startActivityForResult(AddGroupDetailsActivity.newIntent(this, recipients.stream().map(Recipient::getId).collect(Collectors.toList())), REQUEST_CODE_ADD_DETAILS);
|
||||
|
||||
@@ -41,7 +41,7 @@ class GroupManagementRepository @JvmOverloads constructor(private val context: C
|
||||
val groupId: GroupId.Push = potentialGroupId?.requirePush() ?: potentialGroupRecipient!!.requireGroupId().requirePush()
|
||||
|
||||
val recipients = selected.map(Recipient::resolved)
|
||||
.filterNot { it.hasServiceId() && it.isRegistered }
|
||||
.filterNot { it.hasServiceId && it.isRegistered }
|
||||
.toList()
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user