fix(onebot): restore group and doubt request accounts
get_group_system_msg now keeps join and invite records, reports the inviter, and fills a missing requester nick from the user profile. get_doubt_friends_add_request returns the QQ number plus the request message, source, and time that QQ actually sends. Closes #400 Closes #401 Closes #402 Closes #403
This commit is contained in:
13 files changed
+418
-79
No files matched your search
@@ -627,6 +627,30 @@ describe('onebot/contact-actions / getGroupSystemMessages', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('includes admin-approval invitations with the invited account and inviter', async () => {
|
||||
const bridge = fakeBridge({
|
||||
fetchGroupRequests: vi.fn(async (filtered: boolean) => filtered ? [] : [
|
||||
makeGroupRequest({
|
||||
notifyType: 5,
|
||||
eventType: 22,
|
||||
targetUin: 10_001,
|
||||
targetName: 'invitee',
|
||||
invitorUin: 45_678,
|
||||
invitorName: 'inviter',
|
||||
}),
|
||||
]),
|
||||
});
|
||||
|
||||
const result = await getGroupSystemMessages(bridge);
|
||||
|
||||
expect(result).toEqual([expect.objectContaining({
|
||||
requester_uin: 10_001,
|
||||
requester_nick: 'invitee',
|
||||
invitor_uin: 45_678,
|
||||
invitor_nick: 'inviter',
|
||||
})]);
|
||||
});
|
||||
|
||||
it('reports the inviter as requester for group invitations', async () => {
|
||||
const bridge = fakeBridge({
|
||||
fetchGroupRequests: vi.fn(async (filtered: boolean) => filtered ? [] : [
|
||||
@@ -646,6 +670,8 @@ describe('onebot/contact-actions / getGroupSystemMessages', () => {
|
||||
expect(result).toEqual([expect.objectContaining({
|
||||
requester_uin: 45_678,
|
||||
requester_nick: 'inviter',
|
||||
invitor_uin: 45_678,
|
||||
invitor_nick: 'inviter',
|
||||
})]);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user