From 51a611118e06fb6bb1a55dc92bda33f5cf061c44 Mon Sep 17 00:00:00 2001 From: SanaeFox <36219542+Hoshinonyaruko@users.noreply.github.com> Date: Wed, 21 Aug 2024 01:58:57 +0800 Subject: [PATCH] Beta487 (#492) * beta447 * beta448 * beta449 * beta450 * beta451 * beta452 * beta453 * beta454 * beta455 * btea455 * beta456 * beta457 * beta458 * beta460 * beta460 * beta461 * beta462 * beta463 * beta464 * beta465 * beta467 * beta468 * beta469 * beta470 * beta471 * beta472 * beta473 * beta473 * beta475 * beta476 * beta478 * beta479 * beta479 * beta480 * beta481 * beta482 * beta483 * beta484 * beta485 * beta486 * beta486 * beta487 --- Processor/ProcessC2CMessage.go | 2 +- Processor/ProcessGroupMessage.go | 2 +- handlers/send_group_msg.go | 34 +++++++++++++++----------------- 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/Processor/ProcessC2CMessage.go b/Processor/ProcessC2CMessage.go index 2c32f196..4ab7357f 100644 --- a/Processor/ProcessC2CMessage.go +++ b/Processor/ProcessC2CMessage.go @@ -404,7 +404,7 @@ func (p *Processors) ProcessC2CMessage(data *dto.WSC2CMessageData) error { echo.AddMsgIDv3(AppIDString, data.Author.ID, data.ID) //储存当前群或频道号的类型 - idmap.WriteConfigv2(data.Author.ID, "type", "group_private") + //idmap.WriteConfigv2(data.Author.ID, "type", "group_private") //懒message_id池 echo.AddLazyMessageId(data.Author.ID, data.ID, time.Now()) diff --git a/Processor/ProcessGroupMessage.go b/Processor/ProcessGroupMessage.go index f1e0f6e9..54ade658 100644 --- a/Processor/ProcessGroupMessage.go +++ b/Processor/ProcessGroupMessage.go @@ -288,7 +288,7 @@ func (p *Processors) ProcessGroupMessage(data *dto.WSGroupATMessageData) error { echo.AddMsgID(AppIDString, s, data.ID) echo.AddMsgType(AppIDString, s, "group") //储存当前群或频道号的类型 - idmap.WriteConfigv2(data.GroupID, "type", "group") + //idmap.WriteConfigv2(data.GroupID, "type", "group") //懒message_id池 echo.AddLazyMessageId(data.GroupID, data.ID, time.Now()) //懒message_id池 diff --git a/handlers/send_group_msg.go b/handlers/send_group_msg.go index 25c7d72d..505c8394 100644 --- a/handlers/send_group_msg.go +++ b/handlers/send_group_msg.go @@ -99,12 +99,8 @@ func HandleSendGroupMsg(client callapi.Client, api openapi.OpenAPI, apiv2 openap var retmsg string if len(message.Params.GroupID.(string)) == 32 { - idInt64, err = idmap.GenerateRowID(message.Params.GroupID.(string), 9) - // 临时的 msgType = "group" } else if message.Params.UserID != nil && len(message.Params.UserID.(string)) == 32 { - idInt64, err = idmap.GenerateRowID(message.Params.UserID.(string), 9) - // 临时的 msgType = "group_private" } else { if message.Params.GroupID != "" { @@ -114,21 +110,23 @@ func HandleSendGroupMsg(client callapi.Client, api openapi.OpenAPI, apiv2 openap } } - //设置递归 对直接向gsk发送action时有效果 - if msgType == "" { - messageCopy := message - if err != nil { - mylog.Printf("错误:无法转换 ID %v\n", err) - } else { - // 递归3次 - echo.AddMapping(idInt64, 4) - // 递归调用handleSendGroupMsg,使用设置的消息类型 - echo.AddMsgType(config.GetAppIDStr(), idInt64, "group_private") - retmsg, _ = HandleSendGroupMsg(client, api, apiv2, messageCopy) + if message.Params.GroupID != nil && len(message.Params.GroupID.(string)) != 32 { + //设置递归 对直接向gsk发送action时有效果 + if msgType == "" { + messageCopy := message + if err != nil { + mylog.Printf("错误:无法转换 ID %v\n", err) + } else { + // 递归3次 + echo.AddMapping(idInt64, 4) + // 递归调用handleSendGroupMsg,使用设置的消息类型 + echo.AddMsgType(config.GetAppIDStr(), idInt64, "group_private") + retmsg, _ = HandleSendGroupMsg(client, api, apiv2, messageCopy) + } + } else if echo.GetMapping(idInt64) <= 0 { + // 特殊值代表不递归 + echo.AddMapping(idInt64, 10) } - } else if echo.GetMapping(idInt64) <= 0 { - // 特殊值代表不递归 - echo.AddMapping(idInt64, 10) } switch msgType {