diff options
| -rw-r--r-- | lib/utils.ts | 2 | ||||
| -rw-r--r-- | routes/users.ts | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/utils.ts b/lib/utils.ts index 539258a4..c52c8a9c 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -181,5 +181,7 @@ export const fields = [ "prompt", "pubkey", "username", + // when this account last handed its name to v3 (see users.update) + "v3migrated", "website", ]; diff --git a/routes/users.ts b/routes/users.ts index a058e7da..17bf5026 100644 --- a/routes/users.ts +++ b/routes/users.ts @@ -497,6 +497,12 @@ export default { if (typeof body[a] !== "undefined") user[a] = body[a]; } + // A v3 hand-off from the /migrate action. Not the same thing as + // `migrated`, which every account has carried since 2023. Only the + // server sets this, and the names registrar grants the name to a v3 + // key only while it is fresh. + if (body.migrated === true) user.v3migrated = Date.now(); + user.fresh = false; user.tip = Math.max(0, Math.min(1000, Number.parseInt(user.tip))); |
