rpc: return PASSWORD_MISSING for channel transfer without 2FA

messages.editChatCreator unconditionally returned PASSWORD_HASH_INVALID for
an account with no cloud password at all. Real Telegram Desktop's transfer-
ownership flow only recognizes the distinct PASSWORD_MISSING error to show
its "enable 2FA first" box; anything else falls through into the real
password-entry flow, which then has nothing to check against and crashes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Astra 2026-09-13 22:07:54 +01:00
parent 61f6685603
commit f823b2cb74
4 changed files with 75 additions and 3 deletions

View file

@ -11,6 +11,7 @@ import (
var (
ErrPasswordHashInvalid = errors.New("password hash invalid")
ErrPasswordMissing = errors.New("password missing")
ErrSRPIDInvalid = errors.New("srp id invalid")
ErrSRPPasswordChanged = errors.New("srp password changed")
ErrNewSettingsInvalid = errors.New("new password settings invalid")