@badgerclaw/connect 1.4.12 → 1.4.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/group-mentions.ts +12 -0
package/package.json
CHANGED
package/src/group-mentions.ts
CHANGED
|
@@ -29,6 +29,18 @@ function resolveMatrixRoomConfigForGroup(params: ChannelGroupContext) {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export function resolveMatrixGroupRequireMention(params: ChannelGroupContext): boolean {
|
|
32
|
+
// If groupId resolves to a user ID (DM route), never require mention
|
|
33
|
+
const rawGroupId = params.groupId?.trim() ?? "";
|
|
34
|
+
const strippedId = rawGroupId
|
|
35
|
+
.replace(/^badgerclaw:/i, "")
|
|
36
|
+
.replace(/^channel:/i, "")
|
|
37
|
+
.replace(/^room:/i, "")
|
|
38
|
+
.trim();
|
|
39
|
+
if (strippedId.startsWith("@")) {
|
|
40
|
+
// This is a DM peer route, not a group — no mention required
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
|
|
32
44
|
// Check per-room config first (set by /bot talk on|off)
|
|
33
45
|
try {
|
|
34
46
|
const fs = require("fs");
|