From 5c0e2c5773de4666857ef199e56364d34819a026 Mon Sep 17 00:00:00 2001 From: Azure <1608015480@qq.com> Date: Wed, 20 Jul 2022 20:40:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E8=BD=AC=E5=8F=91=E7=A7=81=E8=81=8A=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E6=8A=A5=E9=94=99=20(#287)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/multimsg.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/multimsg.go b/client/multimsg.go index 605688ce..000794e0 100644 --- a/client/multimsg.go +++ b/client/multimsg.go @@ -163,8 +163,12 @@ func (l *forwardMsgLinker) link(name string) *message.ForwardMessage { } } + gid := int64(0) // 给群号一个缺省值0,防止在读合并转发的私聊内容时候会报错 + if m.Head.GroupInfo != nil { + gid = m.Head.GroupInfo.GroupCode.Unwrap() + } nodes = append(nodes, &message.ForwardNode{ - GroupId: m.Head.GroupInfo.GroupCode.Unwrap(), + GroupId: gid, SenderId: m.Head.FromUin.Unwrap(), SenderName: name, Time: m.Head.MsgTime.Unwrap(),