koishi-plugin-foxy-daily 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/comments.js +9 -5
  2. package/package.json +1 -1
package/lib/comments.js CHANGED
@@ -144,13 +144,17 @@ class CommentRunner {
144
144
  const legacy = this.state.commentState(post.id, String(comment.id))
145
145
  if (!legacy) return undefined
146
146
  const siblings = comments.filter((item) => String(item.id) === String(comment.id))
147
- if (siblings.length <= 1) return legacy
147
+ const nonSelf = this.accountId
148
+ ? siblings.filter((item) => String(item.author?.id) !== String(this.accountId))
149
+ : siblings
150
+ if (nonSelf.length <= 1) return nonSelf[0] === comment ? legacy : undefined
148
151
  // Qzone can reuse a raw comment id for a root comment and a nested reply.
149
- // Legacy state has only the raw id; prefer the reply sibling because old
150
- // flows usually consumed the nested reply first.
151
- const replySibling = siblings.find((item) => item.kind === 'reply')
152
+ // Legacy state has only the raw id; prefer the user's reply sibling because
153
+ // old flows usually consumed the nested reply first. Never assign legacy
154
+ // state to Foxy's own reply, which can share the same id.
155
+ const replySibling = nonSelf.find((item) => item.kind === 'reply')
152
156
  if (replySibling) return replySibling === comment ? legacy : undefined
153
- return siblings[0] === comment ? legacy : undefined
157
+ return nonSelf[0] === comment ? legacy : undefined
154
158
  }
155
159
 
156
160
  async listComments(postId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koishi-plugin-foxy-daily",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "LivingMemory-backed Qzone daily posts, nested comments, auto-like and public-feed tools for ChatLuna / Character.",
5
5
  "main": "lib/index.js",
6
6
  "files": [