Esempio n. 1
0
        public void sendMessage(SignalServiceSyncMessage message)
        {
            byte[] content;

            if (message.getContacts().HasValue)
            {
                content = createMultiDeviceContactsContent(message.getContacts().ForceGetValue().Contacts.asStream(),
                                                           message.getContacts().ForceGetValue().Complete);
            }
            else if (message.getGroups().HasValue)
            {
                content = createMultiDeviceGroupsContent(message.getGroups().ForceGetValue().asStream());
            }
            else if (message.getRead().HasValue)
            {
                content = createMultiDeviceReadContent(message.getRead().ForceGetValue());
            }
            else if (message.getBlockedList().HasValue)
            {
                content = createMultiDeviceBlockedContent(message.getBlockedList().ForceGetValue());
            }
            else
            {
                throw new Exception("Unsupported sync message!");
            }

            sendMessage(localAddress, Util.CurrentTimeMillis(), content, false, false);
        }