fix(core): write album comments with the official header fields

The comment packet header only needs the feed time and id. Extra locator fields from the feed cell are not part of the official write.

Refs #436
This commit is contained in:
DrSmoothl committed 2026-09-21 14:13:16 +08:00
1 parent dad2b0c5a7
commit 1dffb22d05
3 files changed
+11 -38

No files matched your search

+5 -10
View File
@@ -2,6 +2,7 @@ import type { JsonObject, JsonValue } from '@snowluma/common/json';
import { createLogger } from '@snowluma/common/logger';
import type {
AlbumCreator,
CommentReqBodyHeader,
CommentReqPhotoInfo,
CommentRespData,
DeleteMediasRequest,
@@ -344,7 +345,7 @@ export class GroupAlbumApi {
groupId: groupId.toString(),
field3: 2,
reqBody: {
field1: commentReqHeader(feed.cellCommon, groupId, albumId, batchId, mediaLloc),
field1: commentReqHeader(feed.cellCommon),
...(ownerUin ? { field2: { field1: { uin: ownerUin } } } : {}),
field5: photoInfo,
},
@@ -693,16 +694,10 @@ function qunFeedCellId(
return `${head}^||^421_1_0_${groupId}|${albumId}|${lloc}^||^0`;
}
function commentReqHeader(
cell: QunFeedCellCommon,
groupId: number,
albumId: string,
batchId: bigint,
lloc: string,
): QunFeedCellCommon {
function commentReqHeader(cell: QunFeedCellCommon): CommentReqBodyHeader {
return {
...cell,
cellId: cell.cellId || qunFeedCellId(groupId, albumId, batchId, lloc),
...(cell.time !== undefined ? { time: cell.time } : {}),
...(cell.feedId ? { feedId: cell.feedId } : {}),
};
}