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:
parent
8e70b22d1c
commit
15069b74b3
@ -1196,3 +1196,18 @@ func (c *QQClient) buildUpdateProfileDetailPacket(profileRecord map[uint16][]byt
|
||||
cl()
|
||||
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)
|
||||
}
|
||||
|
@ -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 修改个人资料
|
||||
func (c *QQClient) UpdateProfile(profile ProfileDetailUpdate) {
|
||||
_, _ = c.sendAndWait(c.buildUpdateProfileDetailPacket(profile))
|
||||
|
@ -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 {
|
||||
if m.Uin == m.Group.client.Uin {
|
||||
return true
|
||||
|
Loading…
x
Reference in New Issue
Block a user