mirror of https://github.com/openclaw/openclaw.git
Fixed testing issue:
- We previously triggered expect(getMemberDisplayName).not.toHaveBeenCalled(); - We now only fetch the displayName when the message contains a formatted_body, as we only need to search those messages for mentions using displayName
This commit is contained in:
parent
ba1c08cd88
commit
82027b46f7
|
|
@ -552,7 +552,9 @@ export function createMatrixRoomMessageHandler(params: MatrixMonitorHandlerParam
|
|||
resolveAgentRoute: core.channel.routing.resolveAgentRoute,
|
||||
});
|
||||
const agentMentionRegexes = core.channel.mentions.buildMentionRegexes(cfg, _route.agentId);
|
||||
const selfDisplayName = await getMemberDisplayName(roomId, selfUserId).catch(() => undefined);
|
||||
const selfDisplayName = content.formatted_body
|
||||
? await getMemberDisplayName(roomId, selfUserId).catch(() => undefined)
|
||||
: undefined;
|
||||
const { wasMentioned, hasExplicitMention } = resolveMentions({
|
||||
content,
|
||||
userId: selfUserId,
|
||||
|
|
|
|||
Loading…
Reference in New Issue