From 1ced7461f23d3124a6652dd157d630089b6465df Mon Sep 17 00:00:00 2001 From: Pinenutn <1101839859@qq.com> Date: Sun, 20 Oct 2024 10:18:44 +0800 Subject: [PATCH 1/4] fix --- dice/platform_adapter_gocq.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dice/platform_adapter_gocq.go b/dice/platform_adapter_gocq.go index 0176740f..e68e2d8b 100644 --- a/dice/platform_adapter_gocq.go +++ b/dice/platform_adapter_gocq.go @@ -991,6 +991,17 @@ func (pa *PlatformAdapterGocq) Serve() int { // {"group_id":564808710,"notice_type":"group_decrease","operator_id":2589922907,"post_type":"notice","self_id":2589922907,"sub_type":"leave","time":1651584460,"user_id":2589922907} groupName := dm.TryGetGroupName(msg.GroupID) txt := fmt.Sprintf("离开群组或群解散: <%s>(%s)", groupName, msgQQ.GroupID) + txtErr := fmt.Sprintf("离开群组或群解散,删除对应群聊信息失败: <%s>(%s)", groupName, msgQQ.GroupID) + // 这个就是要删除的部分,离开这个群组=群组退出=删除对应的群聊绑定信息(也就是用户的骰子和这个群聊无关了) + // 同时考虑到:QQ群团队发布公告称,由于业务调整,“恢复QQ群”功能将于2023年10月13日起正式下线,届时涉及QQ群相关的恢复功能都将无法使用,可以安心删除群聊对应绑定信息。 + group, exists := session.ServiceAtNew.Load(msg.GroupID) + if !exists { + log.Error(txtErr) + ctx.Notice(txtErr) + return + } + // TODO:存疑,根据其他地方的描述,这里的ep.UserID等价于v.DiceID,这样使用是否正确有待进一步测试 + group.DiceIDExistsMap.Delete(ep.UserID) log.Info(txt) ctx.Notice(txt) return From abb4ad4559abcecb96eab9673289f63b083acfc3 Mon Sep 17 00:00:00 2001 From: Pinenutn <1101839859@qq.com> Date: Sun, 20 Oct 2024 10:49:59 +0800 Subject: [PATCH 2/4] =?UTF-8?q?chores:=20=E5=90=8C=E6=AD=A5dismiss?= =?UTF-8?q?=E7=9A=84=E6=93=8D=E4=BD=9C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dice/platform_adapter_gocq.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dice/platform_adapter_gocq.go b/dice/platform_adapter_gocq.go index e68e2d8b..647a2b5a 100644 --- a/dice/platform_adapter_gocq.go +++ b/dice/platform_adapter_gocq.go @@ -1000,8 +1000,9 @@ func (pa *PlatformAdapterGocq) Serve() int { ctx.Notice(txtErr) return } - // TODO:存疑,根据其他地方的描述,这里的ep.UserID等价于v.DiceID,这样使用是否正确有待进一步测试 + // TODO:存疑,根据DISMISS的代码复制而来 group.DiceIDExistsMap.Delete(ep.UserID) + group.UpdatedAtTime = time.Now().Unix() log.Info(txt) ctx.Notice(txt) return From f63868709a043312de23b2a0cc2db73ffd6f818b Mon Sep 17 00:00:00 2001 From: PaienNate <68044286+PaienNate@users.noreply.github.com> Date: Sun, 20 Oct 2024 21:58:56 +0800 Subject: [PATCH 3/4] Update dice/platform_adapter_gocq.go Co-authored-by: JustAnotherID --- dice/platform_adapter_gocq.go | 1 + 1 file changed, 1 insertion(+) diff --git a/dice/platform_adapter_gocq.go b/dice/platform_adapter_gocq.go index 647a2b5a..7a564aff 100644 --- a/dice/platform_adapter_gocq.go +++ b/dice/platform_adapter_gocq.go @@ -996,6 +996,7 @@ func (pa *PlatformAdapterGocq) Serve() int { // 同时考虑到:QQ群团队发布公告称,由于业务调整,“恢复QQ群”功能将于2023年10月13日起正式下线,届时涉及QQ群相关的恢复功能都将无法使用,可以安心删除群聊对应绑定信息。 group, exists := session.ServiceAtNew.Load(msg.GroupID) if !exists { + txtErr := fmt.Sprintf("离开群组或群解散,删除对应群聊信息失败: <%s>(%s)", groupName, msgQQ.GroupID) log.Error(txtErr) ctx.Notice(txtErr) return From 3b2e9600e467bdbc0152983a084c6cf0670c4777 Mon Sep 17 00:00:00 2001 From: PaienNate <68044286+PaienNate@users.noreply.github.com> Date: Sun, 20 Oct 2024 21:59:00 +0800 Subject: [PATCH 4/4] Update dice/platform_adapter_gocq.go Co-authored-by: JustAnotherID --- dice/platform_adapter_gocq.go | 1 - 1 file changed, 1 deletion(-) diff --git a/dice/platform_adapter_gocq.go b/dice/platform_adapter_gocq.go index 7a564aff..11c2a1e0 100644 --- a/dice/platform_adapter_gocq.go +++ b/dice/platform_adapter_gocq.go @@ -991,7 +991,6 @@ func (pa *PlatformAdapterGocq) Serve() int { // {"group_id":564808710,"notice_type":"group_decrease","operator_id":2589922907,"post_type":"notice","self_id":2589922907,"sub_type":"leave","time":1651584460,"user_id":2589922907} groupName := dm.TryGetGroupName(msg.GroupID) txt := fmt.Sprintf("离开群组或群解散: <%s>(%s)", groupName, msgQQ.GroupID) - txtErr := fmt.Sprintf("离开群组或群解散,删除对应群聊信息失败: <%s>(%s)", groupName, msgQQ.GroupID) // 这个就是要删除的部分,离开这个群组=群组退出=删除对应的群聊绑定信息(也就是用户的骰子和这个群聊无关了) // 同时考虑到:QQ群团队发布公告称,由于业务调整,“恢复QQ群”功能将于2023年10月13日起正式下线,届时涉及QQ群相关的恢复功能都将无法使用,可以安心删除群聊对应绑定信息。 group, exists := session.ServiceAtNew.Load(msg.GroupID)