fix: harden msteams mentions and fallback links (#15436) (thanks @hyojin)

This commit is contained in:
Peter Steinberger
2026-02-13 15:08:48 +01:00
parent 604dc700a6
commit 106d605519
5 changed files with 102 additions and 8 deletions

View File

@@ -358,7 +358,8 @@ async function buildActivity(
// Bot Framework doesn't support "reference" attachment type for sending
const fileLink = `📎 [${uploaded.name}](${uploaded.shareUrl})`;
activity.text = msg.text ? `${msg.text}\n\n${fileLink}` : fileLink;
const existingText = typeof activity.text === "string" ? activity.text : undefined;
activity.text = existingText ? `${existingText}\n\n${fileLink}` : fileLink;
return activity;
}