private void processIncomingMessageRecord(MessageRecord record) { try { PushDatabase pushDatabase = DatabaseFactory.getPushDatabase(); var messageDatabase = DatabaseFactory.getMessageDatabase(); messageDatabase.RemoveMismatchedIdentity(record.MessageId, mismatch.RecipientId, mismatch.IdentityKey); SignalServiceEnvelope envelope = new SignalServiceEnvelope((int)SignalServiceProtos.Envelope.Types.Type.PREKEY_BUNDLE, record.IndividualRecipient.getNumber(), (int)record.RecipientDeviceId, "", (long)TimeUtil.GetUnixTimestamp(record.DateSent), Base64.decode(record.Body.Body), null); long pushId = pushDatabase.Insert(envelope); var task = new PushDecryptTask(pushId, record.MessageId, record.IndividualRecipient.getNumber()); App.Current.Worker.AddTaskActivities(task); } catch (IOException e) { throw new Exception(); } }
protected override async Task <string> ExecuteAsync() { PushDatabase database = DatabaseFactory.getPushDatabase(); SignalServiceEnvelope envelope = database.GetEnvelope(_pushMessageId); May <long> optionalSmsMessageId = _smsMessageId > 0 ? new May <long>(_smsMessageId) : May <long> .NoValue; handleMessage(envelope, optionalSmsMessageId); database.Delete(_pushMessageId); return(""); }
protected override async Task <string> ExecuteAsync() { PushDatabase database = DatabaseFactory.getPushDatabase(); TextSecureEnvelope envelope = database.GetEnvelope(messageId); /*Optional<Long> optionalSmsMessageId = smsMessageId > 0 ? Optional.of(smsMessageId) : * Optional.< Long > absent();*/ handleMessage(/*masterSecret,*/ envelope /*, optionalSmsMessageId*/); database.Delete(messageId); return(""); }