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

@@ -9,7 +9,6 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.annimon.stream.Stream;
import com.google.protobuf.InvalidProtocolBufferException;
import org.signal.core.util.BreakIteratorCompat;
import org.signal.core.util.logging.Log;
@@ -24,7 +23,6 @@ import org.thoughtcrime.securesms.stories.Stories;
import org.thoughtcrime.securesms.util.MediaUtil;
import org.thoughtcrime.securesms.util.ParcelUtil;
import org.thoughtcrime.securesms.util.Util;
import org.whispersystems.signalservice.api.messages.shared.SharedContact;
import java.io.IOException;
import java.util.ArrayList;
@@ -102,9 +100,9 @@ public final class MultiShareArgs implements Parcelable {
try {
byte[] data = ParcelUtil.readByteArray(in);
if (data != null) {
bodyRanges = BodyRangeList.parseFrom(data);
bodyRanges = BodyRangeList.ADAPTER.decode(data);
}
} catch (InvalidProtocolBufferException e) {
} catch (IOException e) {
Log.w(TAG, "Invalid body range", e);
}
this.bodyRanges = bodyRanges;
@@ -274,7 +272,7 @@ public final class MultiShareArgs implements Parcelable {
}
if (bodyRanges != null) {
ParcelUtil.writeByteArray(dest, bodyRanges.toByteArray());
ParcelUtil.writeByteArray(dest, bodyRanges.encode());
} else {
ParcelUtil.writeByteArray(dest, null);
}

View File

@@ -390,14 +390,14 @@ public final class MultiShareSender {
{
return OutgoingMessage.textStoryMessage(
recipient,
Base64.encodeBytes(StoryTextPost.newBuilder()
.setBody(getBodyForTextStory(multiShareArgs.getDraftText(), multiShareArgs.getLinkPreview()))
.setStyle(StoryTextPost.Style.DEFAULT)
.setBackground(background.serialize())
.setTextBackgroundColor(0)
.setTextForegroundColor(Color.WHITE)
.build()
.toByteArray()),
Base64.encodeBytes(new StoryTextPost.Builder()
.body(getBodyForTextStory(multiShareArgs.getDraftText(), multiShareArgs.getLinkPreview()))
.style(StoryTextPost.Style.DEFAULT)
.background(background.serialize())
.textBackgroundColor(0)
.textForegroundColor(Color.WHITE)
.build()
.encode()),
sentTimestamp,
storyType.toTextStoryType(),
buildLinkPreviews(context, multiShareArgs.getLinkPreview()),