diff --git a/packages/platform-crossgram/src/index.ts b/packages/platform-crossgram/src/index.ts index b2aaeae8..a4fcb738 100644 --- a/packages/platform-crossgram/src/index.ts +++ b/packages/platform-crossgram/src/index.ts @@ -1032,7 +1032,7 @@ export class QQNTPlatform implements IMPlatform { _session: PlatformSession, target: { conversationId: string, messageId: string, nativeSequence?: string }, button: Extract, - ): Promise<{ message?: string, alert?: boolean, url?: string }> { + ): Promise<{ message?: string, alert?: boolean, url?: string, refresh?: true }> { if (button.data.startsWith('group-invite:')) { const [, groupCode, msgSeq] = button.data.split(':') if (groupCode && msgSeq) { diff --git a/packages/platform-crossgram/src/invite-accept.e2e.test.ts b/packages/platform-crossgram/src/invite-accept.e2e.test.ts index 13fca630..fc36bea7 100644 --- a/packages/platform-crossgram/src/invite-accept.e2e.test.ts +++ b/packages/platform-crossgram/src/invite-accept.e2e.test.ts @@ -106,7 +106,7 @@ describe('QQNT group-invite accept E2E', () => { const edits: IMEvent[] = [] const rpc = new DialogRpc(platform, session, store, undefined, undefined, 1, undefined, undefined, undefined, - async (_session, event) => { edits.push(event); return { updates: [] } }) + async (_session, event) => { edits.push(event) }) // getMessages hydrates the store's conversations and users first so the // direct peer id below resolves as a user id, not a channel one. @@ -116,7 +116,7 @@ describe('QQNT group-invite accept E2E', () => { const peer = { _: 'inputPeerUser' as const, userId: rpc.peerTlId('invite-room'), accessHash: Long.ZERO } await rpc.getHistory({ _: 'messages.getHistory', peer, offsetId: 0, offsetDate: 0, addOffset: 0, - limit: 10, maxId: 0, minId: 0, + limit: 10, maxId: 0, minId: 0, hash: Long.ZERO, }) const message = projected.messages[0] as tl.RawMessage expect(message.replyMarkup).toMatchObject({ diff --git a/packages/platform-crossgram/src/platform.test.ts b/packages/platform-crossgram/src/platform.test.ts index 13eef3e8..a5d42173 100644 --- a/packages/platform-crossgram/src/platform.test.ts +++ b/packages/platform-crossgram/src/platform.test.ts @@ -11,7 +11,7 @@ import { type IMMedia, type PlatformSession, type VoiceWorkerClient, } from '@mtproto-relay/bridge' import { parseQQMarkdown, QQNTPlatform } from './index.js' -import type { QQMediaLocator, WireReactionContext } from './protocol.js' +import type { QQMediaLocator, WireMessage, WireReactionContext } from './protocol.js' import { QQStickerProvider } from './sticker-provider.js' const session: PlatformSession = { @@ -252,7 +252,7 @@ describe('QQNTPlatform mapping', () => { it('renders an accept button for official group-invite cards', async () => { const platform = new QQNTPlatform() - platform.client.getHistory = vi.fn(async () => ({ + platform.client.getHistory = vi.fn(async (): Promise<{ messages: WireMessage[] }> => ({ messages: [{ id: 'invite-message', conversationId: 'direct', senderId: 'friend', timestamp: 1, outgoing: false, parts: [{ type: 'card' as const, card: {