fix: remove phone bypass in addContact/acceptContact to respect privacy settings

This commit is contained in:
wacpi 2026-07-22 05:29:21 +08:00 committed by onysd
parent b9adf46826
commit c1b308877d

View file

@ -685,9 +685,6 @@ func (r *Router) onContactsAddContact(ctx context.Context, req *tg.ContactsAddCo
peerUser := contact.User
peerUser.Contact = true
peerUser.Mutual = contact.Mutual || contact.User.Mutual
if contact.Phone != "" {
peerUser.Phone = contact.Phone
}
if contact.FirstName != "" || contact.LastName != "" {
peerUser.FirstName = contact.FirstName
peerUser.LastName = contact.LastName
@ -742,9 +739,6 @@ func (r *Router) onContactsAcceptContact(ctx context.Context, id tg.InputUserCla
peerUser := contact.User
peerUser.Contact = true
peerUser.Mutual = contact.Mutual || contact.User.Mutual
if contact.Phone != "" {
peerUser.Phone = contact.Phone
}
if contact.FirstName != "" || contact.LastName != "" {
peerUser.FirstName = contact.FirstName
peerUser.LastName = contact.LastName