1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 19:17:38 +08:00

fix typo.

This commit is contained in:
Mrs4s 2020-10-08 21:44:48 +08:00
parent 9c62d22bc2
commit b53aaceaa1
4 changed files with 14 additions and 14 deletions

View File

@ -133,7 +133,7 @@ func (c *QQClient) buildCaptchaPacket(result string, sign []byte) (uint16, []byt
return seq, packet
}
func (c *QQClient) buildSNSRequestPacket() (uint16, []byte) {
func (c *QQClient) buildSMSRequestPacket() (uint16, []byte) {
seq := c.nextSeq()
req := packets.BuildOicqRequestPacket(c.Uin, 0x810, crypto.ECDH, c.RandomKey, func(w *binary.Writer) {
w.WriteUInt16(8)
@ -151,7 +151,7 @@ func (c *QQClient) buildSNSRequestPacket() (uint16, []byte) {
return seq, packet
}
func (c *QQClient) buildSNSCodeSubmitPacket(code string) (uint16, []byte) {
func (c *QQClient) buildSMSCodeSubmitPacket(code string) (uint16, []byte) {
seq := c.nextSeq()
req := packets.BuildOicqRequestPacket(c.Uin, 0x810, crypto.ECDH, c.RandomKey, func(w *binary.Writer) {
w.WriteUInt16(7)

View File

@ -234,8 +234,8 @@ func (c *QQClient) SubmitCaptcha(result string, sign []byte) (*LoginResponse, er
return &l, nil
}
func (c *QQClient) SubmitSNS(code string) (*LoginResponse, error) {
rsp, err := c.sendAndWait(c.buildSNSCodeSubmitPacket(code))
func (c *QQClient) SubmitSMS(code string) (*LoginResponse, error) {
rsp, err := c.sendAndWait(c.buildSMSCodeSubmitPacket(code))
if err != nil {
return nil, err
}
@ -249,13 +249,13 @@ func (c *QQClient) SubmitSNS(code string) (*LoginResponse, error) {
return &l, nil
}
func (c *QQClient) RequestSNS() bool {
rsp, err := c.sendAndWait(c.buildSNSRequestPacket())
func (c *QQClient) RequestSMS() bool {
rsp, err := c.sendAndWait(c.buildSMSRequestPacket())
if err != nil {
c.Error("request sms error: %v", err)
return false
}
return rsp.(LoginResponse).Error == SNSNeededError
return rsp.(LoginResponse).Error == SMSNeededError
}
func (c *QQClient) GetVipInfo(target int64) (*VipInfo, error) {

View File

@ -93,7 +93,7 @@ func decodeLoginResponse(c *QQClient, _ uint16, payload []byte) (interface{}, er
if t204, ok := m[0x204]; ok { // 同时支持扫码验证 ?
return LoginResponse{
Success: false,
Error: SNSOrVerifyNeededError,
Error: SMSOrVerifyNeededError,
VerifyUrl: string(t204),
SMSPhone: phone,
ErrorMessage: string(m[0x17e]),
@ -101,7 +101,7 @@ func decodeLoginResponse(c *QQClient, _ uint16, payload []byte) (interface{}, er
}
return LoginResponse{
Success: false,
Error: SNSNeededError,
Error: SMSNeededError,
SMSPhone: phone,
ErrorMessage: string(m[0x17e]),
}, nil
@ -111,7 +111,7 @@ func decodeLoginResponse(c *QQClient, _ uint16, payload []byte) (interface{}, er
c.t104 = m[0x104]
return LoginResponse{
Success: false,
Error: SNSNeededError,
Error: SMSNeededError,
}, nil
}
@ -128,7 +128,7 @@ func decodeLoginResponse(c *QQClient, _ uint16, payload []byte) (interface{}, er
if t == 162 {
return LoginResponse{
Error: TooManySNSRequestError,
Error: TooManySMSRequestError,
}, nil
}

View File

@ -254,9 +254,9 @@ const (
NeedCaptcha LoginError = 1
OtherLoginError LoginError = 3
UnsafeDeviceError LoginError = 4
SNSNeededError LoginError = 5
TooManySNSRequestError LoginError = 6
SNSOrVerifyNeededError LoginError = 7
SMSNeededError LoginError = 5
TooManySMSRequestError LoginError = 6
SMSOrVerifyNeededError LoginError = 7
SliderNeededError LoginError = 8
UnknownLoginError LoginError = -1