Skip to content

Commit

Permalink
Beta351 (#359)
Browse files Browse the repository at this point in the history
* beta338

* beta319

* beta340

* beta341

* actionfix

* beta342

* beta342

* beta342

* beta344

* beta345

* beta346

* beta347

* beta348

* beta349

* beta350

* beta351
  • Loading branch information
Hoshinonyaruko authored Mar 24, 2024
1 parent db09bdb commit 2da5ba3
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions images/upload_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"net/http"
"net/url"
"regexp"
"strconv"
"strings"
"sync"

Expand Down Expand Up @@ -94,10 +95,12 @@ func UploadBase64ImageToServer(msgid string, base64Image string, groupID string,
}

if config.GetImgUpApiVtv2() && groupID != "" {
if msgid == "" {
msgid = echo.GetLazyMessagesId(groupID)
}

if isNumeric(groupID) {
//用转换前的群号获取msgid
if msgid == "" {
msgid = echo.GetLazyMessagesId(groupID)
}
// 检查groupID是否为纯数字构成 RetrieveRowByIDv2是通用逻辑,也可以将userid还原为32位数originaluserid
// 但没有私信权限,故没有测试
originalGroupID, err := idmap.RetrieveRowByIDv2(groupID)
Expand All @@ -109,6 +112,18 @@ func UploadBase64ImageToServer(msgid string, base64Image string, groupID string,

// 用originalGroupID更新groupID
groupID = originalGroupID
} else {
// 映射str的GroupID到int
GroupID64, err := idmap.StoreIDv2(groupID)
if err != nil {
log.Printf("failed to convert ChannelID to int: %v", err)
return picURL, 0, 0, 0, nil
}
groupIDTemp := strconv.FormatInt(GroupID64, 10)
//用数字的群号获取msgid
if msgid == "" {
msgid = echo.GetLazyMessagesId(groupIDTemp)
}
}
var richMediaMessage *dto.RichMediaMessage
if !config.GetUploadPicV2Base64() {
Expand Down

0 comments on commit 2da5ba3

Please sign in to comment.