build: add local node bin to restart script PATH

This commit is contained in:
Peter Steinberger
2025-12-07 18:49:55 +01:00
parent 558af7a454
commit d463c82c95
31 changed files with 2089 additions and 1851 deletions

View File

@@ -79,8 +79,8 @@ export function deriveSessionKey(scope: SessionScope, ctx: MsgContext) {
}
/**
* Resolve the session key with an optional canonical direct-chat key (e.g., "main").
* All non-group direct chats collapse to `mainKey` when provided, keeping group isolation.
* Resolve the session key with a canonical direct-chat bucket (default: "main").
* All non-group direct chats collapse to this bucket; groups stay isolated.
*/
export function resolveSessionKey(
scope: SessionScope,
@@ -89,8 +89,9 @@ export function resolveSessionKey(
) {
const raw = deriveSessionKey(scope, ctx);
if (scope === "global") return raw;
const canonical = (mainKey ?? "").trim();
// Default to a single shared direct-chat session called "main"; groups stay isolated.
const canonical = (mainKey ?? "main").trim() || "main";
const isGroup = raw.startsWith("group:") || raw.includes("@g.us");
if (!isGroup && canonical) return canonical;
if (!isGroup) return canonical;
return raw;
}