fix(qzone): thread abstime into like, flag unlike endpoint as unverified
Adversarial review (NEEDS-FIXES) of the like/unlike slice: - Missing abstime: every real dolike impl (QLiker.py, CSDN) sends the target feed's post time. Threaded abstime through setQzoneLike → QzoneApi.like → like_qzone/unlike_qzone actions (optional, default 0; pass the feed's real time for reliability). Test asserts it. - internal_unlike_app is the conventional paired CGI but NO public bot impl exercises unlike, so it's best-guess. Labeled UNVERIFIED/pending a live capture in the helper comment, the unlike action summary, and the unlike test — instead of pinning it as confirmed truth (avoiding the re-codify-a-wrong-constant trap the last 3 slices hit). - Documented the success-signal (code/subcode) as extrapolated from sibling CGIs (dolike may use a succ/fail token instead). The confirmed mechanics (dolike CGI, opuin=liker, unikey/curkey mood shape, appid=311, fid=tid) are noted as such.
This commit is contained in:
6 files changed
+87
-24
No files matched your search
@@ -72,16 +72,17 @@ describe('apis/qzone', () => {
|
||||
const getCookies = vi.fn(async () => ({ p_skey: 'PSK' }));
|
||||
const bridge = mockBridge({ apis: { ...mockApiHub(), web: { getCookies } } as never });
|
||||
const likeSpy = vi.spyOn(qzoneWeb, 'setQzoneLike').mockResolvedValue();
|
||||
await new QzoneApi(bridge as never).like('TIDX', undefined, true);
|
||||
// opUin = self ('10001'), owner defaults to self when target_uin absent
|
||||
expect(likeSpy).toHaveBeenCalledWith({ p_skey: 'PSK' }, '10001', '10001', 'TIDX', true);
|
||||
await new QzoneApi(bridge as never).like('TIDX', undefined, true, 1700000000);
|
||||
// opUin = self ('10001'), owner defaults to self when target_uin absent; abstime threaded
|
||||
expect(likeSpy).toHaveBeenCalledWith({ p_skey: 'PSK' }, '10001', '10001', 'TIDX', true, 1700000000);
|
||||
});
|
||||
|
||||
it('like targets a friend\'s space (owner = target_uin) and threads the unlike flag', async () => {
|
||||
it('like targets a friend\'s space (owner = target_uin) and threads the unlike flag + abstime default', async () => {
|
||||
const getCookies = vi.fn(async () => ({ p_skey: 'PSK' }));
|
||||
const bridge = mockBridge({ apis: { ...mockApiHub(), web: { getCookies } } as never });
|
||||
const likeSpy = vi.spyOn(qzoneWeb, 'setQzoneLike').mockResolvedValue();
|
||||
await new QzoneApi(bridge as never).like('TIDX', 20002, false);
|
||||
expect(likeSpy).toHaveBeenCalledWith({ p_skey: 'PSK' }, '10001', '20002', 'TIDX', false);
|
||||
// abstime defaults to 0 when omitted
|
||||
expect(likeSpy).toHaveBeenCalledWith({ p_skey: 'PSK' }, '10001', '20002', 'TIDX', false, 0);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user