(msg: Api.Message)
| 1188 | return canvas; |
| 1189 | } catch (_) { |
| 1190 | return undefined; |
| 1191 | } |
| 1192 | } |
| 1193 | |
| 1194 | function collectAnimatedEmojiIds(messages: any[]): string[] { |
| 1195 | const ids = new Set<string>(); |
| 1196 | const scanEntity = (entity: any) => { |
| 1197 | const id = entity?.custom_emoji_id; |
| 1198 | if (id && animatedCustomEmojiCache.get(String(id))) ids.add(String(id)); |
| 1199 | }; |
| 1200 | const scanMessage = (message: any) => { |
| 1201 | if (!message) return; |
| 1202 | (message.entities || []).forEach(scanEntity); |
| 1203 | (message.caption_entities || []).forEach(scanEntity); |
| 1204 | // Do not let sender emoji_status alone turn a pure-text quote into animated WebM. |
| 1205 | // It is already rendered from customEmojiCache as a static first frame. |
| 1206 | if (message.replyMessage) scanMessage(message.replyMessage); |
| 1207 | if (message.forward) scanMessage(message.forward); |
| 1208 | }; |
| 1209 | messages.forEach(scanMessage); |
| 1210 | return Array.from(ids); |
| 1211 | } |
| 1212 |
nothing calls this directly
no test coverage detected