Compare commits

..

1 Commits

Author SHA1 Message Date
last2014 b33b998ae4 Merge pull request '2026.4.2' (#15) from develop into main
Reviewed-on: #15
2026-05-03 07:36:22 +00:00
4 changed files with 14 additions and 29 deletions
-4
View File
@@ -1,7 +1,3 @@
# 2026.4.3
- Chg: forループ内でlastReadを記録するように
- Chg: lastReadを時刻ベースに
# 2026.4.2 # 2026.4.2
- Fix: id除外が機能しない問題 - Fix: id除外が機能しない問題
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "notice-uwuzu", "name": "notice-uwuzu",
"version": "2026.4.3", "version": "2026.4.2",
"type": "module", "type": "module",
"main": "dist/index.js", "main": "dist/index.js",
"scripts": { "scripts": {
+11 -22
View File
@@ -27,11 +27,16 @@ 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 [index, notification] of notifications.entries()) { for (const notification of notifications) {
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,
}); });
@@ -41,17 +46,6 @@ 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 {
@@ -70,18 +64,13 @@ 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 [index, mention] of mentions.entries()) { for (const mention of mentions) {
const time = new Date(mention.datetime).getTime(); if (lastReadMention === mention.uniqid) {
if (index === 0) {
const mem = Memory.memory;
mem.lastReadMention = time;
Memory.memory = mem;
}
if (lastReadMention >= time)
break; break;
}
ueuses.push(mention); ueuses.push(mention);
} }
+2 -2
View File
@@ -11,8 +11,8 @@ class MemoryClass {
writeFileSync(path, JSON.stringify({ writeFileSync(path, JSON.stringify({
processedInfo: [], processedInfo: [],
permissions: {}, permissions: {},
lastReadMention: 0, lastReadMention: "",
lastReadReply: 0, lastReadReply: "",
userid: "", userid: "",
max_length: 0, max_length: 0,
})); }));