core: feat: QQ ID autofill at registry (#1072)

This commit is contained in:
035966-L3 authored and GitHub committed 2025-11-07 12:47:37 +00:00
1 parent 0ae449515a
commit cc413531f1
1 file changed
+4 -1
+4 -1
View File
@@ -312,7 +312,10 @@ class UserRegisterWithCodeHandler extends Handler {
await token.del(code, token.TYPE_REGISTRATION);
const [id, mailDomain] = this.tdoc.mail.split('@');
const $set: any = this.tdoc.set || {};
if (mailDomain === 'qq.com' && !Number.isNaN(+id)) $set.avatar = `qq:${id}`;
if (mailDomain === 'qq.com' && !Number.isNaN(+id)) {
$set.avatar = `qq:${id}`;
$set.qq = `${id}`;
}
if (this.session.viewLang) $set.viewLang = this.session.viewLang;
if (Object.keys($set).length) await user.setById(uid, $set);
if (Object.keys(this.tdoc.setInDomain || {}).length) await domain.setUserInDomain(domainId, uid, this.tdoc.setInDomain);