Compare commits

...

8 Commits

6 changed files with 42 additions and 18 deletions
+10
View File
@@ -1,3 +1,13 @@
# 2026.4.3
- Chg: forループ内でlastReadを記録するように
- Chg: lastReadを時刻ベースに
# 2026.4.2
- Fix: id除外が機能しない問題
# 2026.4.1
- Chg: notificationsもfor内でlastReadを更新しないように
# 2026.4.0 # 2026.4.0
- Breaking: noticeUwuzuを0から作り直しました - Breaking: noticeUwuzuを0から作り直しました
- Breaking: 25.12.0-alpha.1までの方針を全て廃止しました - Breaking: 25.12.0-alpha.1までの方針を全て廃止しました
+5 -3
View File
@@ -17,12 +17,14 @@ uwuzu v1.6.3以上で利用可能です。
- デバッグモード - デバッグモード
設定で有効化することで、以下の機能が利用できます。 設定で有効化することで、以下の機能が利用できます。
開発以外では使用しないでください。 開発以外では使用しないでください。
- NODE_TLS_REJECT_UNAUTHORIZED=1 - NODE_TLS_REJECT_UNAUTHORIZED=1
暗号化通信を無効化します。 暗号化通信を無効化します。
- 地震情報のWebSocketの接続先をテスト用サンドボックスに変更 - 地震情報のWebSocketの接続先をテスト用サンドボックスに変更
P2P地震情報の接続先を本番環境から[テスト用サンドボックスのエンドポイント](https://www.p2pquake.net/develop/json_api_v2/)に変更します。 P2P地震情報の接続先を本番環境から[テスト用サンドボックスのエンドポイント](https://www.p2pquake.net/develop/json_api_v2/)に変更します。
そのため、最新の情報は配信されません。 そのため、最新の情報は配信されません。
- i18nextのdebugを有効化 - 地震情報のid除外を無効化
地震情報のid除外を記録も確認も行わなくなります。
- i18nextのdebugを有効化
[i18nextでのdebug](https://www.i18next.com/overview/configuration-options#logging)が有効化されます。 [i18nextでのdebug](https://www.i18next.com/overview/configuration-options#logging)が有効化されます。
## 260420.jsonについて ## 260420.jsonについて
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "notice-uwuzu", "name": "notice-uwuzu",
"version": "2026.4.1", "version": "2026.4.3",
"type": "module", "type": "module",
"main": "dist/index.js", "main": "dist/index.js",
"scripts": { "scripts": {
+22 -11
View File
@@ -27,16 +27,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,
}); });
@@ -46,6 +41,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 {
@@ -64,14 +70,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 -1
View File
@@ -68,7 +68,8 @@ if (config.earthquake?.useHistoryData) {
processMessage(message); processMessage(message);
if (!config.debug) { if (!config.debug) {
mem.processedInfo.concat([id]); const mem = Memory.memory;
mem.processedInfo = mem.processedInfo.concat([id]);
Memory.memory = mem; Memory.memory = mem;
} }
}); });
+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,
})); }));