mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-16 21:10:47 +08:00
Add manual IM bot credential access
This commit is contained in:
parent
d5d2c18ce0
commit
7123fce47a
42 changed files with 2458 additions and 889 deletions
|
|
@ -79,3 +79,25 @@ test('QQ bridge accepts only the scanner and requires an at-message event in gro
|
|||
assert.equal(asks, 0);
|
||||
assert.equal(bridge.status.messagesRejected, 1);
|
||||
});
|
||||
|
||||
test('QQ credential-bound bots accept senders within the platform visibility scope', async () => {
|
||||
let asks = 0;
|
||||
const bridge = new QqHarnessBridge({
|
||||
bot: { sendText: async () => {} },
|
||||
ownerUserOpenid: '*',
|
||||
harness: {
|
||||
sessionExists: async () => true,
|
||||
ask: async () => { asks += 1; return 'ok'; },
|
||||
},
|
||||
state: {
|
||||
hasSeen: () => false,
|
||||
markSeen: async () => {},
|
||||
sessionFor: () => 'session',
|
||||
setSession: async () => {},
|
||||
clearSession: async () => {},
|
||||
},
|
||||
});
|
||||
await bridge.accept(message({ messageId: 'visible', senderId: 'visible-user' }));
|
||||
assert.equal(asks, 1);
|
||||
assert.equal(bridge.status.messagesRejected, 0);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue