refactor(state): add ChatData::format_for for the per-site caption format

Four call sites (cache hit, fresh fetch, startup refetch, /debug preview)
spelled out the same message_format.get(...).cloned().unwrap_or_default();
the accessor names the lookup and keeps the empty-format contract in one
place.
This commit is contained in:
2026-09-21 17:27:42 +08:00
parent 26581cfca1
commit dd98a90a45
3 changed files with 12 additions and 19 deletions
+1 -4
View File
@@ -626,10 +626,7 @@ pub(crate) async fn execute_command(
let format = CHAT_STORE
.get(message.chat.id.0)
.await
.message_format
.get(fetched.site_id)
.cloned()
.unwrap_or_default();
.format_for(fetched.site_id);
let caption = preview_caption(
&format,
&fetched.caption,