mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 01:18:28 +00:00
MS Teams: add user mention support
- Add mention parsing and validation logic - Handle mention entities with proper whitespace - Validate mention IDs to prevent false positives from code snippets - Use fake placeholders in tests for privacy
This commit is contained in:
committed by
Peter Steinberger
parent
edfdd12d37
commit
7c6d6ce06f
@@ -19,6 +19,7 @@ import {
|
||||
uploadAndShareSharePoint,
|
||||
} from "./graph-upload.js";
|
||||
import { extractFilename, extractMessageId, getMimeType, isLocalPath } from "./media-helpers.js";
|
||||
import { parseMentions } from "./mentions.js";
|
||||
import { getMSTeamsRuntime } from "./runtime.js";
|
||||
|
||||
/**
|
||||
@@ -269,7 +270,14 @@ async function buildActivity(
|
||||
const activity: Record<string, unknown> = { type: "message" };
|
||||
|
||||
if (msg.text) {
|
||||
activity.text = msg.text;
|
||||
// Parse mentions from text (format: @[Name](id))
|
||||
const { text: formattedText, entities } = parseMentions(msg.text);
|
||||
activity.text = formattedText;
|
||||
|
||||
// Add mention entities if any mentions were found
|
||||
if (entities.length > 0) {
|
||||
activity.entities = entities;
|
||||
}
|
||||
}
|
||||
|
||||
if (msg.mediaUrl) {
|
||||
|
||||
Reference in New Issue
Block a user