@badgerclaw/connect 1.4.12 → 1.4.14
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/src/matrix/monitor/index.ts +1 -1
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");
|
|
@@ -36,7 +36,7 @@ export type MonitorMatrixOpts = {
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
const DEFAULT_MEDIA_MAX_MB = 20;
|
|
39
|
-
export const DEFAULT_STARTUP_GRACE_MS =
|
|
39
|
+
export const DEFAULT_STARTUP_GRACE_MS = 300_000; // 5 minutes — process messages from before/after startup
|
|
40
40
|
|
|
41
41
|
export function isConfiguredMatrixRoomEntry(entry: string): boolean {
|
|
42
42
|
return entry.startsWith("!") || (entry.startsWith("#") && entry.includes(":"));
|