synology_apm_repo.sdk.units.content.saas_teams_chat module¶
Content Layer — Teams/Chat’s HTML rendering. Pure rows -> HTML string
formatting, no I/O; the tree-navigation and message/sticker-fetching logic
that calls this lives in units/saas/teams_chat.py.
- synology_apm_repo.sdk.units.content.saas_teams_chat.render_channel_html(rows, *, channel_name, stickers_by_msg_id=None)¶
One self-contained HTML page (no external resources/JS) for a Teams channel/chat’s messages.
rowsaremsg_info_tablerecords already read from the decompressed message DB; this function itself does no I/O.stickers_by_msg_id—{msg_id: {sticker_url: base64_content}}from_read_stickers— defaults to{}. Messages sort by timestamp (undated rows first), group under a date separator, and resolve a realreply_to_idto its parent’s sender/preview rather than a bare id.Known limitation:
rowsis the caller’s entire channel/chat history (units/saas/teams_chat.py’s ownunit()reads everymsg_info_tablerow, no cap), and this function’s whole result is then held in memory at once as one string inside aLazyArtifact(sized for “a small, fully in-memory blob,” which a genuinely large channel’s transcript is not). Not fixed speculatively — would need a streaming rendering shape, a real architectural change — until a real large-channel sample actually shows this as a practical problem.