private SignalServiceSyncMessage createSynchronizeMessage(SignalServiceEnvelope envelope, SyncMessage content)
        {
            if (content.SentOneofCase == SyncMessage.SentOneofOneofCase.Sent)
            {
                SyncMessage.Types.Sent sentContent = content.Sent;
                return(SignalServiceSyncMessage.forSentTranscript(new SentTranscriptMessage(sentContent.Destination,
                                                                                            (long)sentContent.Timestamp,
                                                                                            createSignalServiceMessage(envelope, sentContent.Message),
                                                                                            (long)sentContent.ExpirationStartTimestamp)));
            }

            if (content.RequestOneofCase == SyncMessage.RequestOneofOneofCase.Request)
            {
                return(SignalServiceSyncMessage.forRequest(new RequestMessage(content.Request)));
            }

            if (content.Read.Count > 0)
            {
                List <ReadMessage> readMessages = new List <ReadMessage>();

                foreach (SyncMessage.Types.Read read in content.Read)
                {
                    readMessages.Add(new ReadMessage(read.Sender, (long)read.Timestamp));
                }

                return(SignalServiceSyncMessage.forRead(readMessages));
            }

            return(SignalServiceSyncMessage.empty());
        }