Skip to content

Commit 7264363

Browse files
authored
Do not show chat message when public transfer is within the same owner account (#39)
1 parent 2e54e58 commit 7264363

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/code/chat/message_cash_transactions.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ func SendCashTransactionsExchangeMessage(ctx context.Context, data code_data.Pro
6464

6565
case intent.SendPublicPayment:
6666
if intentRecord.SendPublicPaymentMetadata.IsWithdrawal {
67+
if intentRecord.InitiatorOwnerAccount == intentRecord.SendPublicPaymentMetadata.DestinationOwnerAccount {
68+
// This is an internal movement of funds across the same Code user's public accounts
69+
return nil
70+
}
71+
6772
verbByMessageReceiver[intentRecord.InitiatorOwnerAccount] = chatpb.ExchangeDataContent_WITHDREW
6873
if len(intentRecord.SendPublicPaymentMetadata.DestinationOwnerAccount) > 0 {
6974
destinationAccountInfoRecord, err := data.GetAccountInfoByTokenAddress(ctx, intentRecord.SendPublicPaymentMetadata.DestinationTokenAccount)

0 commit comments

Comments
 (0)