Skip to content

Commit

Permalink
Fixed ADM transfers with comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
RealBonus committed Apr 15, 2019
1 parent 4b2d79b commit 8d263d5
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,9 @@ extension AdamantTransfersProvider {
let context = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType)
context.parent = stack.container.viewContext

guard let id = recipientAccount.chatroom?.objectID, let chatroom = context.object(with: id) as? Chatroom else {
guard let id = recipientAccount.chatroom?.objectID,
let chatroom = context.object(with: id) as? Chatroom,
let partner = context.object(with: recipientAccount.objectID) as? BaseAccount else {
completion(.failure(.accountNotFound(address: recipient)))
return
}
Expand All @@ -384,6 +386,7 @@ extension AdamantTransfersProvider {
transaction.statusEnum = MessageStatus.pending
transaction.comment = comment
transaction.fee = transferFee as NSDecimalNumber
transaction.partner = partner

chatroom.addToTransactions(transaction)

Expand Down

0 comments on commit 8d263d5

Please sign in to comment.