Enable kotlin for libsignal-service project and convert SignalServiceDataMessage.

This commit is contained in:
Cody Henthorne
2022-12-08 10:28:24 -05:00
parent fb0aa55cbb
commit ff882edeae
13 changed files with 553 additions and 838 deletions

View File

@@ -68,7 +68,7 @@ public class PointerAttachment extends Attachment {
return results;
}
public static List<Attachment> forPointers(List<SignalServiceDataMessage.Quote.QuotedAttachment> pointers) {
public static List<Attachment> forPointers(@Nullable List<SignalServiceDataMessage.Quote.QuotedAttachment> pointers) {
List<Attachment> results = new LinkedList<>();
if (pointers != null) {

View File

@@ -198,6 +198,7 @@ import java.util.concurrent.TimeUnit;
* Takes data about a decrypted message, transforms it into user-presentable data, and writes that
* data to our data stores.
*/
@SuppressWarnings({ "OptionalGetWithoutIsPresent", "OptionalIsPresent" })
public final class MessageContentProcessor {
private static final String TAG = Log.tag(MessageContentProcessor.class);
@@ -616,7 +617,7 @@ public final class MessageContentProcessor {
database.markAsMissedCall(smsMessageId.get(), message.getType() == OfferMessage.Type.VIDEO_CALL);
} else {
RemotePeer remotePeer = new RemotePeer(senderRecipient.getId(), new CallId(message.getId()));
byte[] remoteIdentityKey = ApplicationDependencies.getProtocolStore().aci().identities().getIdentityRecord(senderRecipient.getId()).map(record -> record.getIdentityKey().serialize()).orElse(null);
byte[] remoteIdentityKey = ApplicationDependencies.getProtocolStore().aci().identities().getIdentityRecord(senderRecipient.getId()).map(record -> record.getIdentityKey().serialize()).get();
ApplicationDependencies.getSignalCallManager()
.receivedOffer(new WebRtcData.CallMetadata(remotePeer, content.getSenderDevice()),
@@ -634,7 +635,7 @@ public final class MessageContentProcessor {
{
log(String.valueOf(content), "handleCallAnswerMessage...");
RemotePeer remotePeer = new RemotePeer(senderRecipient.getId(), new CallId(message.getId()));
byte[] remoteIdentityKey = ApplicationDependencies.getProtocolStore().aci().identities().getIdentityRecord(senderRecipient.getId()).map(record -> record.getIdentityKey().serialize()).orElse(null);
byte[] remoteIdentityKey = ApplicationDependencies.getProtocolStore().aci().identities().getIdentityRecord(senderRecipient.getId()).map(record -> record.getIdentityKey().serialize()).get();
ApplicationDependencies.getSignalCallManager()
.receivedAnswer(new WebRtcData.CallMetadata(remotePeer, content.getSenderDevice()),