mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 19:17:38 +08:00
update voice.
This commit is contained in:
parent
2a32e62327
commit
cd20d7d43d
@ -386,7 +386,10 @@ func (c *QQClient) buildDeleteOnlinePushPacket(uin int64, seq uint16, delMsg []j
|
|||||||
func (c *QQClient) buildGroupSendingPacket(groupCode int64, r int32, forward bool, m *message.SendingMessage) (uint16, []byte) {
|
func (c *QQClient) buildGroupSendingPacket(groupCode int64, r int32, forward bool, m *message.SendingMessage) (uint16, []byte) {
|
||||||
seq := c.nextSeq()
|
seq := c.nextSeq()
|
||||||
var ptt *message.GroupVoiceElement
|
var ptt *message.GroupVoiceElement
|
||||||
if i := m.FirstOrNil(func(e message.IMessageElement) bool { return e.Type() == message.Voice }); i != nil {
|
if i := m.FirstOrNil(func(e message.IMessageElement) bool {
|
||||||
|
_, ok := e.(*message.GroupVoiceElement)
|
||||||
|
return ok
|
||||||
|
}); i != nil {
|
||||||
ptt = i.(*message.GroupVoiceElement)
|
ptt = i.(*message.GroupVoiceElement)
|
||||||
m.Elements = []message.IMessageElement{}
|
m.Elements = []message.IMessageElement{}
|
||||||
}
|
}
|
||||||
|
@ -269,6 +269,16 @@ func (c *QQClient) parseGroupMessage(m *msg.Message) *message.GroupMessage {
|
|||||||
Elements: message.ParseMessageElems(m.Body.RichText.Elems),
|
Elements: message.ParseMessageElems(m.Body.RichText.Elems),
|
||||||
//OriginalElements: m.Body.RichText.Elems,
|
//OriginalElements: m.Body.RichText.Elems,
|
||||||
}
|
}
|
||||||
|
if m.Body.RichText.Ptt != nil {
|
||||||
|
g.Elements = []message.IMessageElement{
|
||||||
|
&message.VoiceElement{
|
||||||
|
Name: m.Body.RichText.Ptt.FileName,
|
||||||
|
Md5: m.Body.RichText.Ptt.FileMd5,
|
||||||
|
Size: m.Body.RichText.Ptt.FileSize,
|
||||||
|
DownloadPara: string(m.Body.RichText.Ptt.DownPara),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
if m.Body.RichText.Attr != nil {
|
if m.Body.RichText.Attr != nil {
|
||||||
g.InternalId = m.Body.RichText.Attr.Random
|
g.InternalId = m.Body.RichText.Attr.Random
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,16 @@ type GroupImageElement struct {
|
|||||||
Url string
|
Url string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type VoiceElement struct {
|
||||||
|
Name string
|
||||||
|
Md5 []byte
|
||||||
|
Size int32
|
||||||
|
DownloadPara string
|
||||||
|
|
||||||
|
// --- sending ---
|
||||||
|
Data []byte
|
||||||
|
}
|
||||||
|
|
||||||
type GroupVoiceElement struct {
|
type GroupVoiceElement struct {
|
||||||
Data []byte
|
Data []byte
|
||||||
Ptt *msg.Ptt
|
Ptt *msg.Ptt
|
||||||
@ -186,6 +196,10 @@ func (e *GroupVoiceElement) Type() ElementType {
|
|||||||
return Voice
|
return Voice
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (e *VoiceElement) Type() ElementType {
|
||||||
|
return Voice
|
||||||
|
}
|
||||||
|
|
||||||
var faceMap = map[int]string{
|
var faceMap = map[int]string{
|
||||||
14: "微笑",
|
14: "微笑",
|
||||||
1: "撇嘴",
|
1: "撇嘴",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user