fix: history not tracked on nnas endpoint, not scrubbed

This commit is contained in:
limes
2026-08-29 16:26:45 +02:00
parent 0bb3d86fa9
commit 7f9d91b3b7
2 changed files with 3 additions and 0 deletions

View File

@@ -352,6 +352,7 @@ PNIDSchema.method('scrub', async function scrub() {
this.email.reachable = false;
this.email.validated = false;
this.email.validated_date = '';
this.email.history.splice(0);
this.email.id = 0;
this.region = 0;
this.timezone.name = '';

View File

@@ -735,6 +735,8 @@ router.put('/@me/emails/@primary', async (request: express.Request, response: ex
return;
}
pnid.email.history.unshift({ old: pnid.email.address, new: email.address.toLowerCase(), on: new Date() });
// TODO - Better email check
pnid.email.address = email.address.toLowerCase();
pnid.email.reachable = false;