Commit 2694f9f3 authored by Finn Herzfeld's avatar Finn Herzfeld 🌵

Fix transcript messages

parent d709c3fa
Pipeline #3308 passed with stages
in 13 minutes and 54 seconds
* Copyright (C) 2018 Finn Herzfeld
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <>.
package io.finn.signald;
import org.whispersystems.signalservice.api.messages.multidevice.SentTranscriptMessage;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
class JsonSentTranscriptMessage {
String destination;
long timestamp;
long expirationStartTimestamp;
JsonDataMessage message;
Map<String, Boolean> unidentifiedStatus = new HashMap<>();
boolean isRecipientUpdate;
JsonSentTranscriptMessage(SentTranscriptMessage s, Manager m) {
if(s.getDestination().isPresent()) {
destination = s.getDestination().get();
timestamp = s.getTimestamp();
expirationStartTimestamp = s.getExpirationStartTimestamp();
message = new JsonDataMessage(s.getMessage(), m);
for(String r : s.getRecipients()) {
unidentifiedStatus.put(r, s.isUnidentified(r));
isRecipientUpdate = s.isRecipientUpdate();
......@@ -25,7 +25,7 @@ import org.whispersystems.signalservice.internal.util.Base64;
import java.util.List;
class JsonSyncMessage {
JsonDataMessage sentMessage;
JsonSentTranscriptMessage sent;
JsonAttachment contacts;
boolean contactsComplete;
JsonAttachment groups;
......@@ -50,7 +50,7 @@ class JsonSyncMessage {
if (syncMessage.getSent().isPresent()) {
this.sentMessage = new JsonDataMessage(syncMessage.getSent().get().getMessage(), null);
this.sent = new JsonSentTranscriptMessage(syncMessage.getSent().get(), m);
if (syncMessage.getBlockedList().isPresent()) {
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment