|
|
@@ -167,13 +167,15 @@ public class StandardAccountMessageService implements AccountMessageService { |
|
|
|
approval.setRequestContact(policy.findContactByUuid(approval.getRequest().getContact())); |
|
|
|
getCompletionHandler(approval).confirm(approval, data); |
|
|
|
|
|
|
|
final AccountMessage confirm = messageDAO.create( |
|
|
|
new AccountMessage(approval).setMessageType(AccountMessageType.confirmation)); |
|
|
|
final AccountMessage confirm = new AccountMessage(approval).setMessageType(AccountMessageType.confirmation); |
|
|
|
if (approval.hasConfirmationTokensToRemove()) { |
|
|
|
final RedisService tokens = getConfirmationTokens(); |
|
|
|
for (String toRemove : approval.getConfirmationTokensToRemove()) tokens.del(toRemove); |
|
|
|
} |
|
|
|
return confirm; |
|
|
|
|
|
|
|
// Write AccountMessage entity into database only if Account is still available in there |
|
|
|
// (i.e. not removed with block_delete deletion policy) |
|
|
|
return accountDAO.exists(confirm.getAccount()) ? messageDAO.create(confirm) : confirm; |
|
|
|
|
|
|
|
} else if (approvalStatus.ok()) { |
|
|
|
if (approval.hasConfirmationTokensToRemove()) { |
|
|
|