( manifest: GoogleChatManifest, groupInfo: GoogleChatGroupInfo, ownerId: string | undefined )
| 256 | } |
| 257 | |
| 258 | function deriveChatName( |
| 259 | manifest: GoogleChatManifest, |
| 260 | groupInfo: GoogleChatGroupInfo, |
| 261 | ownerId: string | undefined |
| 262 | ): string { |
| 263 | if (manifest.chatName?.trim()) return manifest.chatName.trim() |
| 264 | if (manifest.chatType === 'group' && groupInfo.name?.trim()) return groupInfo.name.trim() |
| 265 | |
| 266 | const otherMember = (groupInfo.members ?? []) |
| 267 | .map(normalizeIdentity) |
| 268 | .find((member) => !ownerId || member.platformId !== ownerId) |
| 269 | return ( |
| 270 | otherMember?.name || |
| 271 | groupInfo.members?.map((member) => normalizeIdentity(member).name).join(', ') || |
| 272 | manifest.chatId |
| 273 | ) |
| 274 | } |
| 275 | |
| 276 | async function* parseGoogleChat(options: ParseOptions): AsyncGenerator<ParseEvent, void, unknown> { |
| 277 | const { filePath, batchSize = 5000, onProgress, onLog } = options |
no test coverage detected