mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
fix: update msg seqId
This commit is contained in:
parent
c3c9e74832
commit
17af156451
@ -118,11 +118,10 @@ class DBUtil {
|
||||
this.db.put(shortIdKey, msg.msgId).then();
|
||||
this.db.put(longIdKey, JSON.stringify(msg)).then();
|
||||
try {
|
||||
if (!(await this.db.get(seqIdKey))) {
|
||||
this.db.put(seqIdKey, msg.msgId).then();
|
||||
}
|
||||
await this.db.get(seqIdKey)
|
||||
} catch (e) {
|
||||
|
||||
// log("新的seqId", seqIdKey)
|
||||
this.db.put(seqIdKey, msg.msgId).then();
|
||||
}
|
||||
this.cache[shortIdKey] = this.cache[longIdKey] = msg;
|
||||
if (!this.cache[seqIdKey]) {
|
||||
@ -142,7 +141,7 @@ class DBUtil {
|
||||
try {
|
||||
existMsg = await this.getMsgByLongId(msg.msgId)
|
||||
} catch (e) {
|
||||
return
|
||||
existMsg = msg
|
||||
}
|
||||
}
|
||||
|
||||
@ -155,11 +154,10 @@ class DBUtil {
|
||||
}
|
||||
this.db.put(shortIdKey, msg.msgId).then();
|
||||
try {
|
||||
if (!(await this.db.get(seqIdKey))) {
|
||||
this.db.put(seqIdKey, msg.msgId).then();
|
||||
}
|
||||
await this.db.get(seqIdKey)
|
||||
} catch (e) {
|
||||
|
||||
this.db.put(seqIdKey, msg.msgId).then();
|
||||
// log("更新seqId error", e.stack, seqIdKey);
|
||||
}
|
||||
// log("更新消息", existMsg.msgSeq, existMsg.msgShortId, existMsg.msgId);
|
||||
}
|
||||
@ -197,11 +195,11 @@ class DBUtil {
|
||||
if (this.cache[key]) {
|
||||
return this.cache[key] as FileCache
|
||||
}
|
||||
try{
|
||||
try {
|
||||
|
||||
let data = await this.db.get(key);
|
||||
return JSON.parse(data);
|
||||
}catch (e) {
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ export class OB11Constructor {
|
||||
continue
|
||||
}
|
||||
}catch (e) {
|
||||
log("获取不到引用的消息", e.stack)
|
||||
log("获取不到引用的消息", e.stack, element.replyElement.replayMsgSeq)
|
||||
}
|
||||
|
||||
} else if (element.picElement) {
|
||||
@ -119,7 +119,7 @@ export class OB11Constructor {
|
||||
if (url){
|
||||
message_data["data"]["url"] = IMAGE_HTTP_HOST + url
|
||||
}
|
||||
else if (fileMd5){
|
||||
else if (fileMd5 && element.picElement.fileUuid.indexOf("_") === -1){ // fileuuid有下划线的是Linux发送的,这个url是另外的格式,目前尚未得知如何组装
|
||||
message_data["data"]["url"] = `${IMAGE_HTTP_HOST}/gchatpic_new/0/0-0-${fileMd5.toUpperCase()}/0`
|
||||
}
|
||||
// message_data["data"]["file_id"] = element.picElement.fileUuid
|
||||
|
Loading…
x
Reference in New Issue
Block a user