fix(protocol): support image replies in existing temp sessions
Allow image replies in existing group temporary conversations while preserving passive-only restrictions. Missing, expired, or mismatched sessions remain rejected before media processing, and sending never creates or refreshes a session. Fixes #471
This commit is contained in:
11 files changed
+210
-30
No files matched your search
@@ -36,6 +36,20 @@ const params: Ntv2UploadRequest.Params = {
|
||||
};
|
||||
|
||||
describe('Ntv2UploadRequest', () => {
|
||||
it.each([
|
||||
{ tempGroupId: 0 },
|
||||
{ tempGroupId: -1 },
|
||||
{ tempGroupId: 1.5 },
|
||||
{ tempGroupId: 700, isGroup: true },
|
||||
{ tempGroupId: 700, targetIdOrUid: '' },
|
||||
{ tempGroupId: 700, targetIdOrUid: 1001 },
|
||||
])('rejects invalid temp context before sending: %j', async (invalid) => {
|
||||
const sendRawPacket = vi.fn();
|
||||
await expect(Ntv2UploadRequest.invoke({ sendRawPacket }, { ...params, ...invalid }))
|
||||
.rejects.toThrow('invalid temp-session image upload context');
|
||||
expect(sendRawPacket).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('sends the resolved command on the default OIDB wire name', async () => {
|
||||
const sendRawPacket = vi.fn(async () => packet({
|
||||
upload: { msgInfo: { msgInfoBody: [] } },
|
||||
|
||||
Reference in new issue
Block a user