Convert SignalService, Database, Group, Payment, and other remaining protos to wire.

This commit is contained in:
Cody Henthorne
2023-09-18 15:32:43 -04:00
committed by Alex Hart
parent a6b7d0bcc5
commit efbd5cab85
267 changed files with 7100 additions and 7214 deletions

View File

@@ -8,7 +8,7 @@ import org.thoughtcrime.securesms.recipients.Recipient;
/**
* Represents a card showing user details for a recipient under review.
*
* <p>
* See {@link ReviewCardViewHolder} for usage.
*/
class ReviewCard {
@@ -25,11 +25,11 @@ class ReviewCard {
@Nullable Action primaryAction,
@Nullable Action secondaryAction)
{
this.reviewRecipient = reviewRecipient;
this.inCommonGroupsCount = inCommonGroupsCount;
this.cardType = cardType;
this.primaryAction = primaryAction;
this.secondaryAction = secondaryAction;
this.reviewRecipient = reviewRecipient;
this.inCommonGroupsCount = inCommonGroupsCount;
this.cardType = cardType;
this.primaryAction = primaryAction;
this.secondaryAction = secondaryAction;
}
@NonNull Recipient getReviewRecipient() {
@@ -45,10 +45,10 @@ class ReviewCard {
}
@Nullable ProfileChangeDetails.StringChange getNameChange() {
if (reviewRecipient.getProfileChangeDetails() == null || !reviewRecipient.getProfileChangeDetails().hasProfileNameChange()) {
if (reviewRecipient.getProfileChangeDetails() == null || reviewRecipient.getProfileChangeDetails().profileNameChange == null) {
return null;
} else {
return reviewRecipient.getProfileChangeDetails().getProfileNameChange();
return reviewRecipient.getProfileChangeDetails().profileNameChange;
}
}

View File

@@ -91,8 +91,8 @@ class ReviewCardViewHolder extends RecyclerView.ViewHolder {
if (reviewCard.getNameChange() != null) {
subtextLine2.setText(SpanUtil.italic(context.getString(R.string.ReviewCard__recently_changed,
reviewCard.getNameChange().getPrevious(),
reviewCard.getNameChange().getNew())));
reviewCard.getNameChange().previous,
reviewCard.getNameChange().newValue)));
}
}

View File

@@ -45,11 +45,11 @@ public class ReviewRecipient {
int weight1 = recipient1.getRecipient().getId().equals(alwaysFirstId) ? -100 : 0;
int weight2 = recipient2.getRecipient().getId().equals(alwaysFirstId) ? -100 : 0;
if (recipient1.getProfileChangeDetails() != null && recipient1.getProfileChangeDetails().hasProfileNameChange()) {
if (recipient1.getProfileChangeDetails() != null && recipient1.getProfileChangeDetails().profileNameChange != null) {
weight1--;
}
if (recipient2.getProfileChangeDetails() != null && recipient2.getProfileChangeDetails().hasProfileNameChange()) {
if (recipient2.getProfileChangeDetails() != null && recipient2.getProfileChangeDetails().profileNameChange != null) {
weight2--;
}

View File

@@ -113,7 +113,7 @@ public final class ReviewUtil {
private static @NonNull ProfileChangeDetails getProfileChangeDetails(@NonNull MessageRecord messageRecord) {
try {
return ProfileChangeDetails.parseFrom(Base64.decode(messageRecord.getBody()));
return ProfileChangeDetails.ADAPTER.decode(Base64.decode(messageRecord.getBody()));
} catch (IOException e) {
throw new IllegalArgumentException(e);
}