Skip to content

Commit

Permalink
Beta403 (#403)
Browse files Browse the repository at this point in the history
* beta399

* beta400

* beta401

* beta402

* beta403
  • Loading branch information
Hoshinonyaruko authored May 10, 2024
1 parent a2589c7 commit 2ad7514
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions handlers/send_group_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func HandleSendGroupMsg(client callapi.Client, api openapi.OpenAPI, apiv2 openap
messageID = echo.GetLazyMessagesId(message.Params.GroupID.(string))
mylog.Printf("GetLazyMessagesId: %v", messageID)
//如果应用端传递了user_id 就让at不要顺序乱套
if message.Params.UserID != nil {
if message.Params.UserID != nil && message.Params.UserID.(string) != "" && message.Params.UserID.(string) != "0" {
messageID = echo.GetLazyMessagesIdv2(message.Params.GroupID.(string), message.Params.UserID.(string))
mylog.Printf("GetLazyMessagesIdv2: %v", messageID)
} else {
Expand All @@ -148,7 +148,7 @@ func HandleSendGroupMsg(client callapi.Client, api openapi.OpenAPI, apiv2 openap
}
var originalGroupID, originalUserID string
// 检查UserID是否为nil
if message.Params.UserID != nil && config.GetIdmapPro() {
if message.Params.UserID != nil && config.GetIdmapPro() && message.Params.UserID.(string) != "" && message.Params.UserID.(string) != "0" {
// 如果UserID不是nil且配置为使用Pro版本,则调用RetrieveRowByIDv2Pro
originalGroupID, originalUserID, err = idmap.RetrieveRowByIDv2Pro(message.Params.GroupID.(string), message.Params.UserID.(string))
if err != nil {
Expand Down Expand Up @@ -198,7 +198,7 @@ func HandleSendGroupMsg(client callapi.Client, api openapi.OpenAPI, apiv2 openap
//mylog.Println("foundItems:", foundItems)
if messageID == "" {
// 检查 UserID 是否为 nil
if message.Params.UserID != nil {
if message.Params.UserID != nil && message.Params.UserID.(string) != "" && message.Params.UserID.(string) != "0" {
messageID = GetMessageIDByUseridAndGroupid(config.GetAppIDStr(), message.Params.UserID, message.Params.GroupID)
mylog.Println("通过GetMessageIDByUseridAndGroupid函数获取的message_id:", message.Params.GroupID, messageID)
} else {
Expand Down Expand Up @@ -481,7 +481,7 @@ func HandleSendGroupMsg(client callapi.Client, api openapi.OpenAPI, apiv2 openap
//用GroupID给ChannelID赋值,因为我们是把频道虚拟成了群
message.Params.ChannelID = message.Params.GroupID.(string)
var RChannelID string
if message.Params.UserID != nil && config.GetIdmapPro() {
if message.Params.UserID != nil && config.GetIdmapPro() && message.Params.UserID.(string) != "" && message.Params.UserID.(string) != "0" {
RChannelID, _, err = idmap.RetrieveRowByIDv2Pro(message.Params.ChannelID.(string), message.Params.UserID.(string))
mylog.Printf("测试,通过Proid获取的RChannelID:%v", RChannelID)
}
Expand Down Expand Up @@ -531,7 +531,7 @@ func HandleSendGroupMsg(client callapi.Client, api openapi.OpenAPI, apiv2 openap
//用GroupID给ChannelID赋值,因为我们是把频道虚拟成了群
message.Params.ChannelID = message.Params.GroupID.(string)
var RChannelID string
if message.Params.UserID != nil && config.GetIdmapPro() {
if message.Params.UserID != nil && config.GetIdmapPro() && message.Params.UserID.(string) != "" && message.Params.UserID.(string) != "0" {
RChannelID, _, err = idmap.RetrieveRowByIDv2Pro(message.Params.ChannelID.(string), message.Params.UserID.(string))
mylog.Printf("测试,通过Proid获取的RChannelID:%v", RChannelID)
}
Expand Down
6 changes: 3 additions & 3 deletions handlers/send_group_msg_raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func HandleSendGroupMsgRaw(client callapi.Client, api openapi.OpenAPI, apiv2 ope

var originalGroupID, originalUserID string
// 检查UserID是否为nil
if message.Params.UserID != nil && config.GetIdmapPro() {
if message.Params.UserID != nil && config.GetIdmapPro() && message.Params.UserID.(string) != "" && message.Params.UserID.(string) != "0" {
// 如果UserID不是nil且配置为使用Pro版本,则调用RetrieveRowByIDv2Pro
originalGroupID, originalUserID, err = idmap.RetrieveRowByIDv2Pro(message.Params.GroupID.(string), message.Params.UserID.(string))
if err != nil {
Expand Down Expand Up @@ -410,7 +410,7 @@ func HandleSendGroupMsgRaw(client callapi.Client, api openapi.OpenAPI, apiv2 ope
//用GroupID给ChannelID赋值,因为我们是把频道虚拟成了群
message.Params.ChannelID = message.Params.GroupID.(string)
var RChannelID string
if message.Params.UserID != nil && config.GetIdmapPro() {
if message.Params.UserID != nil && config.GetIdmapPro() && message.Params.UserID.(string) != "" && message.Params.UserID.(string) != "0" {
RChannelID, _, err = idmap.RetrieveRowByIDv2Pro(message.Params.ChannelID.(string), message.Params.UserID.(string))
mylog.Printf("测试,通过Proid获取的RChannelID:%v", RChannelID)
}
Expand Down Expand Up @@ -460,7 +460,7 @@ func HandleSendGroupMsgRaw(client callapi.Client, api openapi.OpenAPI, apiv2 ope
//用GroupID给ChannelID赋值,因为我们是把频道虚拟成了群
message.Params.ChannelID = message.Params.GroupID.(string)
var RChannelID string
if message.Params.UserID != nil && config.GetIdmapPro() {
if message.Params.UserID != nil && config.GetIdmapPro() && message.Params.UserID.(string) != "" && message.Params.UserID.(string) != "0" {
RChannelID, _, err = idmap.RetrieveRowByIDv2Pro(message.Params.ChannelID.(string), message.Params.UserID.(string))
mylog.Printf("测试,通过Proid获取的RChannelID:%v", RChannelID)
}
Expand Down
4 changes: 2 additions & 2 deletions handlers/send_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func HandleSendMsg(client callapi.Client, api openapi.OpenAPI, apiv2 openapi.Ope
//用GroupID给ChannelID赋值,因为我们是把频道虚拟成了群
message.Params.ChannelID = message.Params.GroupID.(string)
var RChannelID string
if message.Params.UserID != nil && config.GetIdmapPro() {
if message.Params.UserID != nil && config.GetIdmapPro() && message.Params.UserID.(string) != "" && message.Params.UserID.(string) != "0" {
RChannelID, _, err = idmap.RetrieveRowByIDv2Pro(message.Params.ChannelID.(string), message.Params.UserID.(string))
mylog.Printf("测试,通过Proid获取的RChannelID:%v", RChannelID)
}
Expand All @@ -150,7 +150,7 @@ func HandleSendMsg(client callapi.Client, api openapi.OpenAPI, apiv2 openapi.Ope
//用GroupID给ChannelID赋值,因为我们是把频道虚拟成了群
message.Params.ChannelID = message.Params.GroupID.(string)
var RChannelID string
if message.Params.UserID != nil && config.GetIdmapPro() {
if message.Params.UserID != nil && config.GetIdmapPro() && message.Params.UserID.(string) != "" && message.Params.UserID.(string) != "0" {
RChannelID, _, err = idmap.RetrieveRowByIDv2Pro(message.Params.ChannelID.(string), message.Params.UserID.(string))
mylog.Printf("测试,通过Proid获取的RChannelID:%v", RChannelID)
}
Expand Down

0 comments on commit 2ad7514

Please sign in to comment.