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