1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 11:07:40 +08:00

fix: drop oneof in oidb.D89AGroupinfo

RomiChan/protobuf don't support oneof now
This commit is contained in:
wdvxdr 2021-12-12 14:58:30 +08:00
parent 5ff69f3c3a
commit 503db83375
No known key found for this signature in database
GPG Key ID: 703F8C071DE7A1B6
3 changed files with 31 additions and 53 deletions

View File

@ -956,15 +956,14 @@ func (c *QQClient) buildGroupMemoUpdatePacket(groupCode int64, newMemo string) (
// OidbSvc.0x89a_0
func (c *QQClient) buildGroupMuteAllPacket(groupCode int64, mute bool) (uint16, []byte) {
shutUpTime := int32(0)
if mute {
shutUpTime = 268435455
}
body := &oidb.D89AReqBody{
GroupCode: groupCode,
StGroupInfo: &oidb.D89AGroupinfo{
ShutupTime: &oidb.D89AGroupinfo_Val{Val: func() int32 {
if mute {
return 268435455
}
return 0
}()},
ShutupTime: shutUpTime,
},
}
return c.buildGroupOperationPacket(body)

View File

@ -222,9 +222,7 @@ type D89AGroupinfo struct {
StGroupNewguidelines *D89AGroupNewGuidelinesInfo `protobuf:"bytes,14,opt"`
GroupFace int32 `protobuf:"varint,15,opt"`
AddOption int32 `protobuf:"varint,16,opt"`
// Types that are assignable to ShutupTime:
// *D89AGroupinfo_Val
ShutupTime isD89AGroupinfo_ShutupTime `protobuf_oneof:"shutupTime"`
ShutupTime int32 `protobuf:"varint,17,opt"`
GroupTypeFlag int32 `protobuf:"varint,18,opt"`
StringGroupTag []byte `protobuf:"bytes,19,opt"`
MsgGroupGeoInfo *D89AGroupGeoInfo `protobuf:"bytes,20,opt"`
@ -360,16 +358,9 @@ func (x *D89AGroupinfo) GetAddOption() int32 {
return 0
}
func (m *D89AGroupinfo) GetShutupTime() isD89AGroupinfo_ShutupTime {
if m != nil {
return m.ShutupTime
}
return nil
}
func (x *D89AGroupinfo) GetVal() int32 {
if x, ok := x.GetShutupTime().(*D89AGroupinfo_Val); ok {
return x.Val
func (x *D89AGroupinfo) GetShutupTime() int32 {
if x != nil {
return x.ShutupTime
}
return 0
}
@ -521,16 +512,6 @@ func (x *D89AGroupinfo) GetMsgLimitFrequency() int32 {
return 0
}
type isD89AGroupinfo_ShutupTime interface {
isD89AGroupinfo_ShutupTime()
}
type D89AGroupinfo_Val struct {
Val int32 `protobuf:"varint,17,opt"`
}
func (*D89AGroupinfo_Val) isD89AGroupinfo_ShutupTime() {}
type D89AGroupNewGuidelinesInfo struct {
BoolEnabled bool `protobuf:"varint,1,opt"`
IngContent []byte `protobuf:"bytes,2,opt"`

View File

@ -57,9 +57,7 @@ message D89AGroupinfo {
D89AGroupNewGuidelinesInfo stGroupNewguidelines = 14;
int32 groupFace = 15;
int32 addOption = 16;
oneof shutupTime {
int32 val = 17;
}
int32 shutupTime = 17;
int32 groupTypeFlag = 18;
bytes stringGroupTag = 19;
D89AGroupGeoInfo msgGroupGeoInfo = 20;