mirror of
https://github.com/yincongcyincong/wechat_chatter.git
synced 2026-07-15 10:26:52 +08:00
fix path printing and etc as per pr review.
This commit is contained in:
+4
-3
@@ -168,7 +168,7 @@ function readUtf8StringIfReadable(addr) {
|
||||
if (!isReadablePointer(addr)) {
|
||||
return "";
|
||||
}
|
||||
return addr.readUtf8String();
|
||||
return addr.readUtf8String(4096);
|
||||
} catch (e) {
|
||||
return "";
|
||||
}
|
||||
@@ -186,9 +186,10 @@ function readByteArrayIfReadable(addr, len) {
|
||||
}
|
||||
|
||||
function sendDownloadChunks(dataPtr, dataLen, fileId, cdnUrl) {
|
||||
if (!fileId || !cdnUrl || dataLen <= 0) {
|
||||
if (!cdnUrl || dataLen <= 0) {
|
||||
return;
|
||||
}
|
||||
const safeFileId = fileId || "";
|
||||
|
||||
for (let offset = 0; offset < dataLen; offset += DOWNLOAD_CHUNK_BYTES) {
|
||||
const chunkLen = Math.min(DOWNLOAD_CHUNK_BYTES, dataLen - offset);
|
||||
@@ -201,7 +202,7 @@ function sendDownloadChunks(dataPtr, dataLen, fileId, cdnUrl) {
|
||||
send({
|
||||
type: "download",
|
||||
media: Array.from(uint8Array),
|
||||
file_id: fileId,
|
||||
file_id: safeFileId,
|
||||
cdn_url: cdnUrl,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -48,4 +48,4 @@ echo "⚙️ CGO_LDFLAGS=$CGO_LDFLAGS"
|
||||
|
||||
go build -v -o onebot .
|
||||
|
||||
echo "🎉 编译成功!二进制文件位置: $(pwd)/onebot/onebot"
|
||||
echo "🎉 编译成功!二进制文件位置: $(pwd)/onebot"
|
||||
|
||||
Reference in New Issue
Block a user