mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 19:17:38 +08:00
add: group.Quit().
This commit is contained in:
parent
06234f080b
commit
0136cb21d9
@ -869,3 +869,27 @@ func (c *QQClient) buildMultiApplyDownPacket(resId string) (uint16, []byte) {
|
|||||||
packet := packets.BuildUniPacket(c.Uin, seq, "MultiMsg.ApplyDown", 1, c.OutGoingPacketSessionId, EmptyBytes, c.sigInfo.d2Key, payload)
|
packet := packets.BuildUniPacket(c.Uin, seq, "MultiMsg.ApplyDown", 1, c.OutGoingPacketSessionId, EmptyBytes, c.sigInfo.d2Key, payload)
|
||||||
return seq, packet
|
return seq, packet
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ProfileService.GroupMngReq
|
||||||
|
func (c *QQClient) buildQuitGroupPacket(groupCode int64) (uint16, []byte) {
|
||||||
|
seq := c.nextSeq()
|
||||||
|
jw := jce.NewJceWriter()
|
||||||
|
jw.WriteInt32(2, 0)
|
||||||
|
jw.WriteInt64(c.Uin, 1)
|
||||||
|
jw.WriteBytes(binary.NewWriterF(func(w *binary.Writer) {
|
||||||
|
w.WriteUInt32(uint32(c.Uin))
|
||||||
|
w.WriteUInt32(uint32(groupCode))
|
||||||
|
}), 2)
|
||||||
|
buf := &jce.RequestDataVersion3{Map: map[string][]byte{"GroupMngReq": packRequestDataV3(jw.Bytes())}}
|
||||||
|
pkt := &jce.RequestPacket{
|
||||||
|
IVersion: 3,
|
||||||
|
IRequestId: c.nextPacketSeq(),
|
||||||
|
SServantName: "KQQ.ProfileService.ProfileServantObj",
|
||||||
|
SFuncName: "GroupMngReq",
|
||||||
|
SBuffer: buf.ToBytes(),
|
||||||
|
Context: map[string]string{},
|
||||||
|
Status: map[string]string{},
|
||||||
|
}
|
||||||
|
packet := packets.BuildUniPacket(c.Uin, seq, "ProfileService.GroupMngReq", 1, c.OutGoingPacketSessionId, EmptyBytes, c.sigInfo.d2Key, pkt.ToBytes())
|
||||||
|
return seq, packet
|
||||||
|
}
|
||||||
|
@ -584,6 +584,10 @@ func (c *QQClient) groupMute(groupCode, memberUin int64, time uint32) {
|
|||||||
_, _ = c.sendAndWait(c.buildGroupMutePacket(groupCode, memberUin, time))
|
_, _ = c.sendAndWait(c.buildGroupMutePacket(groupCode, memberUin, time))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *QQClient) quitGroup(groupCode int64) {
|
||||||
|
_, _ = c.sendAndWait(c.buildQuitGroupPacket(groupCode))
|
||||||
|
}
|
||||||
|
|
||||||
func (c *QQClient) kickGroupMember(groupCode, memberUin int64, msg string) {
|
func (c *QQClient) kickGroupMember(groupCode, memberUin int64, msg string) {
|
||||||
_, _ = c.sendAndWait(c.buildGroupKickPacket(groupCode, memberUin, msg))
|
_, _ = c.sendAndWait(c.buildGroupKickPacket(groupCode, memberUin, msg))
|
||||||
}
|
}
|
||||||
|
@ -188,6 +188,12 @@ func (g *GroupInfo) MuteAll(mute bool) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (g *GroupInfo) Quit() {
|
||||||
|
if g.SelfPermission() != Owner {
|
||||||
|
g.client.quitGroup(g.Code)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (m *GroupMemberInfo) DisplayName() string {
|
func (m *GroupMemberInfo) DisplayName() string {
|
||||||
if m.CardName == "" {
|
if m.CardName == "" {
|
||||||
return m.Nickname
|
return m.Nickname
|
||||||
|
Loading…
x
Reference in New Issue
Block a user