diff --git a/client/c2c_processor.go b/client/c2c_processor.go
index 47664dfe..1e18a1b0 100644
--- a/client/c2c_processor.go
+++ b/client/c2c_processor.go
@@ -178,24 +178,26 @@ func privatePttDecoder(c *QQClient, pMsg *msg.Message, _ *c2cExtraOption) {
return
}
if len(pMsg.Body.RichText.Ptt.Reserve) != 0 {
- //m := binary.NewReader(pMsg.Body.RichText.Ptt.Reserve[1:]).ReadTlvMap(1)
+ // m := binary.NewReader(pMsg.Body.RichText.Ptt.Reserve[1:]).ReadTlvMap(1)
// T3 -> timestamp T8 -> voiceType T9 -> voiceLength T10 -> PbReserveStruct
}
c.dispatchFriendMessage(c.parsePrivateMessage(pMsg))
}
func tempSessionDecoder(c *QQClient, pMsg *msg.Message, _ *c2cExtraOption) {
- if pMsg.Head.C2CTmpMsgHead == nil {
+ if pMsg.Head.C2CTmpMsgHead == nil || pMsg.Body == nil {
return
}
- group := c.FindGroupByUin(pMsg.Head.C2CTmpMsgHead.GetGroupUin())
- if group == nil {
- return
+ if pMsg.Head.GetMsgType() == 529 && pMsg.Head.GetC2CCmd() == 6 {
+ group := c.FindGroup(pMsg.Head.C2CTmpMsgHead.GetGroupCode())
+ if group == nil {
+ return
+ }
+ if pMsg.Head.GetFromUin() == c.Uin {
+ return
+ }
+ c.dispatchTempMessage(c.parseTempMessage(pMsg))
}
- if pMsg.Head.GetFromUin() == c.Uin {
- return
- }
- c.dispatchTempMessage(c.parseTempMessage(pMsg))
}
func troopAddMemberBroadcastDecoder(c *QQClient, pMsg *msg.Message, _ *c2cExtraOption) {
diff --git a/message/elements.go b/message/elements.go
index 324dbfbb..04647d03 100644
--- a/message/elements.go
+++ b/message/elements.go
@@ -253,11 +253,16 @@ func NewReply(m *GroupMessage) *ReplyElement {
}
func NewUrlShare(url, title, content, image string) *ServiceElement {
- template := fmt.Sprintf(`- %s%s
`,
- url, url, image, title, content,
+ template := fmt.Sprintf(`- %v%v
`,
+ title, url, image, title, content,
)
+ /*
+ template := fmt.Sprintf(`- %s%s
`,
+ url, url, image, title, content,
+ )
+ */
return &ServiceElement{
- Id: 33,
+ Id: 1,
Content: template,
ResId: url,
SubType: "UrlShare",
diff --git a/message/pack.go b/message/pack.go
index 2450cddf..b8a79232 100644
--- a/message/pack.go
+++ b/message/pack.go
@@ -128,7 +128,7 @@ func (e *FriendImageElement) Pack() (r []*msg.Elem) {
func (e *ServiceElement) Pack() (r []*msg.Elem) {
r = []*msg.Elem{}
// id =35 已移至 ForwardElement
- if e.Id == 33 {
+ if e.Id == 1 {
r = append(r, &msg.Elem{
Text: &msg.Text{Str: &e.ResId},
})