(buffer: Buffer)
| 537 | function emojiStatusPayload(entity: any, customEmojiBuffer?: Buffer): any | undefined { |
| 538 | const id = emojiStatusIdFromEntity(entity); |
| 539 | if (!id) return undefined; |
| 540 | // Always string ID for vendor map lookups |
| 541 | return { custom_emoji_id: String(id), ...(customEmojiBuffer ? { customEmojiBuffer } : {}) }; |
| 542 | } |
| 543 | |
| 544 | function displayName(entity: any): string { |
| 545 | if (!entity) return "User"; |
| 546 | const first = entity.firstName || entity.first_name || ""; |
| 547 | const last = entity.lastName || entity.last_name || ""; |
| 548 | const title = entity.title || ""; |
| 549 | const username = entity.username ? `@${entity.username}` : ""; |
| 550 | return [first, last].filter(Boolean).join(" ") || title || username || "User"; |
| 551 | } |
| 552 | |
| 553 | function fwdHeaderName(fwd: any): string | undefined { |
| 554 | return fwd?.fromName || fwd?.from_name || fwd?.postAuthor || fwd?.post_author || undefined; |
| 555 | } |
| 556 | |
| 557 | function fwdPeer(fwd: any): any | undefined { |
| 558 | return fwd?.fromId ?? fwd?.from_id ?? fwd?.savedFromPeer ?? fwd?.saved_from_peer; |
| 559 | } |
| 560 |
no test coverage detected