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

support SetGroupAnonymous (#312)

This commit is contained in:
BeautyyuYanli 2023-01-31 17:05:43 +08:00 committed by GitHub
parent 8e70b22d1c
commit 15069b74b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 0 deletions

View File

@ -1196,3 +1196,18 @@ func (c *QQClient) buildUpdateProfileDetailPacket(profileRecord map[uint16][]byt
cl() cl()
return c.uniPacket("OidbSvc.0x4ff_9_IMCore", payload) return c.uniPacket("OidbSvc.0x4ff_9_IMCore", payload)
} }
// OidbSvc.0x568_22
func (c *QQClient) buildSetGroupAnonymous(groupCode int64, enable bool) (uint16, []byte) {
var t byte = 0
if enable {
t = 1
}
b, cl := binary.OpenWriterF(func(w *binary.Writer) {
w.WriteUInt32(uint32(groupCode))
w.WriteByte(t)
})
payload := c.packOIDBPackage(1384, 22, b)
cl()
return c.uniPacket("OidbSvc.0x568_22", payload)
}

View File

@ -790,6 +790,10 @@ func (g *GroupInfo) removeMember(uin int64) {
}) })
} }
func (c *QQClient) setGroupAnonymous(groupCode int64, enable bool) {
_, _ = c.sendAndWait(c.buildSetGroupAnonymous(groupCode, enable))
}
// UpdateProfile 修改个人资料 // UpdateProfile 修改个人资料
func (c *QQClient) UpdateProfile(profile ProfileDetailUpdate) { func (c *QQClient) UpdateProfile(profile ProfileDetailUpdate) {
_, _ = c.sendAndWait(c.buildUpdateProfileDetailPacket(profile)) _, _ = c.sendAndWait(c.buildUpdateProfileDetailPacket(profile))

View File

@ -408,6 +408,12 @@ func (m *GroupMemberInfo) Mute(time uint32) error {
} }
} }
func (g *GroupInfo) SetAnonymous(enable bool) {
if g.AdministratorOrOwner() {
g.client.setGroupAnonymous(g.Code, enable)
}
}
func (m *GroupMemberInfo) Manageable() bool { func (m *GroupMemberInfo) Manageable() bool {
if m.Uin == m.Group.client.Uin { if m.Uin == m.Group.client.Uin {
return true return true