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

Merge pull request #214 from lz1998/protocol

update protocol id
This commit is contained in:
Mrs4s 2021-12-17 17:48:30 +08:00 committed by GitHub
commit 10bac416ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View File

@ -343,11 +343,12 @@ const (
Administrator MemberPermission = 2 Administrator MemberPermission = 2
Member MemberPermission = 3 Member MemberPermission = 3
Unset ClientProtocol = 0
AndroidPhone ClientProtocol = 1 AndroidPhone ClientProtocol = 1
IPad ClientProtocol = 2 AndroidWatch ClientProtocol = 2
AndroidWatch ClientProtocol = 3 MacOS ClientProtocol = 3
MacOS ClientProtocol = 4 QiDian ClientProtocol = 4
QiDian ClientProtocol = 5 IPad ClientProtocol = 5
) )
func (r *UserJoinGroupRequest) Accept() { func (r *UserJoinGroupRequest) Accept() {

View File

@ -301,8 +301,6 @@ func (info *DeviceInfo) ToJson() []byte {
VendorOSName: string(info.VendorOSName), VendorOSName: string(info.VendorOSName),
Protocol: func() int { Protocol: func() int {
switch info.Protocol { switch info.Protocol {
case IPad:
return 0
case AndroidPhone: case AndroidPhone:
return 1 return 1
case AndroidWatch: case AndroidWatch:
@ -311,6 +309,8 @@ func (info *DeviceInfo) ToJson() []byte {
return 3 return 3
case QiDian: case QiDian:
return 4 return 4
case IPad:
return 5
} }
return 0 return 0
}(), }(),
@ -375,6 +375,8 @@ func (info *DeviceInfo) ReadJson(d []byte) error {
info.Protocol = MacOS info.Protocol = MacOS
case 4: case 4:
info.Protocol = QiDian info.Protocol = QiDian
case 5:
info.Protocol = IPad
default: default:
info.Protocol = IPad info.Protocol = IPad
} }