mirror of
https://github.com/IT4Change/gradido.git
synced 2026-03-01 12:44:43 +00:00
remove email exchange of recepient-user between involved communities
This commit is contained in:
parent
ede4b12ed1
commit
6b558c9256
@ -15,6 +15,7 @@ import {
|
||||
EncryptedTransferArgs,
|
||||
fullName,
|
||||
interpretEncryptedTransferArgs,
|
||||
sendTransactionReceivedEmail,
|
||||
TransactionTypeId,
|
||||
} from 'core'
|
||||
import { randomBytes } from 'crypto'
|
||||
@ -661,6 +662,12 @@ export class TransactionLinkResolver {
|
||||
if (methodLogger.isDebugEnabled()) {
|
||||
methodLogger.debug('Disburse JWT was sent successfully with result=', result)
|
||||
}
|
||||
const senderUser = await findUserByIdentifier(senderGradidoId, senderCommunityUuid)
|
||||
if (!senderUser) {
|
||||
const errmsg = `Sender user not found with identifier=${senderGradidoId}`
|
||||
methodLogger.error(errmsg)
|
||||
throw new LogError(errmsg)
|
||||
}
|
||||
const recipientUser = await findUserByIdentifier(recipientGradidoId, recipientCommunityUuid)
|
||||
if (!recipientUser) {
|
||||
const errmsg = `Recipient user not found with identifier=${recipientGradidoId}`
|
||||
|
||||
@ -14,7 +14,6 @@ export class SendCoinsResultLoggingView extends AbstractLoggingView {
|
||||
recipFirstName: this.self.recipFirstName?.substring(0, 3),
|
||||
recipLastName: this.self.recipLastName?.substring(0, 3),
|
||||
recipAlias: this.self.recipAlias?.substring(0, 3),
|
||||
recipEmail: this.self.recipEmail?.substring(0, 3),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,7 +20,4 @@ export class SendCoinsResult {
|
||||
|
||||
@Field(() => String, { nullable: true })
|
||||
recipAlias: string | null
|
||||
|
||||
@Field(() => String, { nullable: true })
|
||||
recipEmail: string | null
|
||||
}
|
||||
|
||||
@ -168,7 +168,7 @@ export async function processXComCompleteTransaction(
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
await sendTransactionReceivedEmail({
|
||||
firstName: foreignUser.firstName,
|
||||
lastName: foreignUser.lastName,
|
||||
@ -180,6 +180,7 @@ export async function processXComCompleteTransaction(
|
||||
senderEmail: senderUser.emailContact.email,
|
||||
transactionAmount: new Decimal(amount),
|
||||
})
|
||||
*/
|
||||
if (dbTransactionLink) {
|
||||
await sendTransactionLinkRedeemedEmail({
|
||||
firstName: senderUser.firstName,
|
||||
@ -188,7 +189,7 @@ export async function processXComCompleteTransaction(
|
||||
language: senderUser.language,
|
||||
senderFirstName: foreignUser.firstName,
|
||||
senderLastName: foreignUser.lastName,
|
||||
senderEmail: foreignUser.emailContact.email,
|
||||
senderEmail: 'unknown', // foreignUser.emailContact.email,
|
||||
transactionAmount: new Decimal(amount),
|
||||
transactionMemo: memo,
|
||||
})
|
||||
@ -509,7 +510,6 @@ export async function processXComCommittingSendCoins(
|
||||
}
|
||||
sendCoinsResult.recipGradidoID = pendingTx.linkedUserGradidoID
|
||||
sendCoinsResult.recipAlias = recipient.recipAlias
|
||||
sendCoinsResult.recipEmail = recipient.recipEmail
|
||||
}
|
||||
} catch (err) {
|
||||
methodLogger.error(
|
||||
|
||||
@ -45,6 +45,7 @@ export async function storeForeignUser(
|
||||
foreignUser = await DbUser.save(foreignUser)
|
||||
|
||||
logger.debug('new foreignUser inserted:', new UserLoggingView(foreignUser))
|
||||
/*
|
||||
if (committingResult.recipEmail !== null) {
|
||||
let foreignUserEmail = DbUserContact.create()
|
||||
foreignUserEmail.email = committingResult.recipEmail!
|
||||
@ -59,19 +60,20 @@ export async function storeForeignUser(
|
||||
foreignUser.emailId = foreignUserEmail.id
|
||||
foreignUser = await DbUser.save(foreignUser)
|
||||
}
|
||||
|
||||
*/
|
||||
return foreignUser
|
||||
} else if (
|
||||
user.firstName !== committingResult.recipFirstName ||
|
||||
user.lastName !== committingResult.recipLastName ||
|
||||
user.alias !== committingResult.recipAlias ||
|
||||
user.alias !== committingResult.recipAlias/* ||
|
||||
(user.emailContact === null && committingResult.recipEmail !== null) ||
|
||||
(user.emailContact !== null &&
|
||||
user.emailContact?.email !== null &&
|
||||
user.emailContact?.email !== committingResult.recipEmail)
|
||||
*/
|
||||
) {
|
||||
logger.debug(
|
||||
'foreignUser still exists, but with different name, alias or email:',
|
||||
'foreignUser still exists, but with different name or alias:',
|
||||
new UserLoggingView(user),
|
||||
committingResult,
|
||||
)
|
||||
@ -84,6 +86,7 @@ export async function storeForeignUser(
|
||||
if (committingResult.recipAlias !== null) {
|
||||
user.alias = committingResult.recipAlias
|
||||
}
|
||||
/*
|
||||
if (!user.emailContact && committingResult.recipEmail !== null) {
|
||||
logger.debug(
|
||||
'creating new userContact:',
|
||||
@ -110,6 +113,7 @@ export async function storeForeignUser(
|
||||
user.emailId = userContact.id
|
||||
logger.debug('foreignUserEmail updated:', new UserContactLoggingView(userContact))
|
||||
}
|
||||
*/
|
||||
await DbUser.save(user)
|
||||
logger.debug('update recipient successful.', new UserLoggingView(user))
|
||||
return user
|
||||
|
||||
@ -128,7 +128,6 @@ export class SendCoinsResolver {
|
||||
receiverUser.firstName,
|
||||
receiverUser.lastName,
|
||||
receiverUser.alias,
|
||||
receiverUser.emailContact.email,
|
||||
)
|
||||
const responseJwt = await encryptAndSign(
|
||||
responseArgs,
|
||||
|
||||
@ -8,7 +8,7 @@ export class SendCoinsResponseJwtPayloadType extends JwtPayloadType {
|
||||
recipFirstName: string | null
|
||||
recipLastName: string | null
|
||||
recipAlias: string | null
|
||||
recipEmail: string | null
|
||||
|
||||
|
||||
constructor(
|
||||
handshakeID: string,
|
||||
@ -17,7 +17,6 @@ export class SendCoinsResponseJwtPayloadType extends JwtPayloadType {
|
||||
recipFirstName: string | null,
|
||||
recipLastName: string | null,
|
||||
recipAlias: string | null,
|
||||
recipEmail: string | null,
|
||||
) {
|
||||
super(handshakeID)
|
||||
this.tokentype = SendCoinsResponseJwtPayloadType.SEND_COINS_RESPONSE_TYPE
|
||||
@ -26,6 +25,5 @@ export class SendCoinsResponseJwtPayloadType extends JwtPayloadType {
|
||||
this.recipFirstName = recipFirstName
|
||||
this.recipLastName = recipLastName
|
||||
this.recipAlias = recipAlias
|
||||
this.recipEmail = recipEmail
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user