Skip to content

Commit

Permalink
Beta487 (#492)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Hoshinonyaruko authored Aug 20, 2024
1 parent fc935b8 commit 51a6111
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Processor/ProcessC2CMessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion Processor/ProcessGroupMessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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池
Expand Down
34 changes: 16 additions & 18 deletions handlers/send_group_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand All @@ -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 {
Expand Down

0 comments on commit 51a6111

Please sign in to comment.