Skip to content

Commit

Permalink
Do not show chat message when public transfer is within the same owne…
Browse files Browse the repository at this point in the history
…r account (#39)
  • Loading branch information
jeffyanta authored Jan 18, 2024
1 parent 2e54e58 commit 7264363
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/code/chat/message_cash_transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ func SendCashTransactionsExchangeMessage(ctx context.Context, data code_data.Pro

case intent.SendPublicPayment:
if intentRecord.SendPublicPaymentMetadata.IsWithdrawal {
if intentRecord.InitiatorOwnerAccount == intentRecord.SendPublicPaymentMetadata.DestinationOwnerAccount {
// This is an internal movement of funds across the same Code user's public accounts
return nil
}

verbByMessageReceiver[intentRecord.InitiatorOwnerAccount] = chatpb.ExchangeDataContent_WITHDREW
if len(intentRecord.SendPublicPaymentMetadata.DestinationOwnerAccount) > 0 {
destinationAccountInfoRecord, err := data.GetAccountInfoByTokenAddress(ctx, intentRecord.SendPublicPaymentMetadata.DestinationTokenAccount)
Expand Down

0 comments on commit 7264363

Please sign in to comment.