2026.4.3 #16

Merged
last2014 merged 4 commits from develop into main 2026-05-03 10:19:42 +00:00
2 changed files with 24 additions and 13 deletions
Showing only changes of commit 4f2be0e0ed - Show all commits
+22 -11
View File
@@ -29,16 +29,11 @@ try {
const mem = Memory.memory; const mem = Memory.memory;
const lastReadReply = mem.lastReadReply; const lastReadReply = mem.lastReadReply;
mem.lastReadReply = notifications[0]?.valueid ?? lastReadReply;
Memory.memory = mem;
for (const notification of notifications) { for (const [index, notification] of notifications.entries()) {
if (notification.category !== "reply" || typeof notification.valueid !== "string") if (notification.category !== "reply" || typeof notification.valueid !== "string")
continue; continue;
if (lastReadReply === notification.valueid)
break;
const ueuseResponse = await client.request("ueuse/get", { const ueuseResponse = await client.request("ueuse/get", {
uniqid: notification.valueid, uniqid: notification.valueid,
}); });
@@ -48,6 +43,17 @@ try {
continue; continue;
} }
const time = new Date(ueuseResponse.data[0].datetime).getTime();
if (index === 0) {
const mem = Memory.memory;
mem.lastReadReply = time;
Memory.memory = mem;
}
if (lastReadReply >= time)
break;
ueuses.push(ueuseResponse.data[0]); ueuses.push(ueuseResponse.data[0]);
} }
} else { } else {
@@ -67,14 +73,19 @@ try {
const mem = Memory.memory; const mem = Memory.memory;
const lastReadMention = mem.lastReadMention; const lastReadMention = mem.lastReadMention;
mem.lastReadMention = mentions[0]?.uniqid ?? lastReadMention;
Memory.memory = mem;
for (const mention of mentions) { for (const [index, mention] of mentions.entries()) {
if (lastReadMention === mention.uniqid) { const time = new Date(mention.datetime).getTime();
break;
if (index === 0) {
const mem = Memory.memory;
mem.lastReadMention = time;
Memory.memory = mem;
} }
if (lastReadMention >= time)
break;
ueuses.push(mention); ueuses.push(mention);
} }
} else { } else {
+2 -2
View File
@@ -11,8 +11,8 @@ class MemoryClass {
writeFileSync(path, JSON.stringify({ writeFileSync(path, JSON.stringify({
processedInfo: [], processedInfo: [],
permissions: {}, permissions: {},
lastReadMention: "", lastReadMention: 0,
lastReadReply: "", lastReadReply: 0,
userid: "", userid: "",
max_length: 0, max_length: 0,
})); }));