Revert "rpc: show the real signup email in an email-signup account's own self view"

This reverts commit 95c08f54bf.
This commit is contained in:
Astra 2026-09-21 15:46:50 +01:00
parent 86c1ebc5de
commit 26d746abee
2 changed files with 1 additions and 63 deletions

View file

@ -13,24 +13,13 @@ func tgSelfUser(u domain.User) *tg.User {
if u.Deleted {
return &tg.User{ID: u.ID, Deleted: true}
}
phone := u.Phone
if u.SignupEmail != "" {
// Self view only: an email-signup account's users.phone is a random,
// meaningless "888" display number (see internal/domain/emailphone.go
// and cmd/createuser) -- showing the real signup email in its place is
// what the account's own My Account / Edit Profile screen should
// display. Never do this in tgUser (how *other* viewers see this
// account): the phone field there is already privacy-gated, and this
// would leak the email past that gate to anyone allowed to see a phone.
phone = u.SignupEmail
}
out := &tg.User{
ID: u.ID,
AccessHash: u.AccessHash,
FirstName: u.FirstName,
LastName: u.LastName,
Username: u.Username,
Phone: phone,
Phone: u.Phone,
Self: true,
Verified: u.Verified,
Scam: u.Scam,