Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/platform-crossgram/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@ export class QQNTPlatform implements IMPlatform<QQMediaLocator> {
_session: PlatformSession,
target: { conversationId: string, messageId: string, nativeSequence?: string },
button: Extract<import('@mtproto-relay/bridge').IMInlineKeyboardButton, { type: 'callback' }>,
): 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) {
Expand Down
4 changes: 2 additions & 2 deletions packages/platform-crossgram/src/invite-accept.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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({
Expand Down
4 changes: 2 additions & 2 deletions packages/platform-crossgram/src/platform.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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: {
Expand Down
Loading