From 24aef4d4c7d01131c2779dc901a3c7207c2646e6 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Mon, 2 Feb 2026 17:05:19 -0800 Subject: [PATCH 1/2] Do not autoreply --- ts/observervault/messageHandler.preload.ts | 52 +--------------------- 1 file changed, 2 insertions(+), 50 deletions(-) diff --git a/ts/observervault/messageHandler.preload.ts b/ts/observervault/messageHandler.preload.ts index 70ec420ff..2c1db8df8 100644 --- a/ts/observervault/messageHandler.preload.ts +++ b/ts/observervault/messageHandler.preload.ts @@ -36,9 +36,6 @@ import { getMessageById } from '../messages/getMessageById.preload.js'; const log = createLogger('observervault/messageHandler'); -// The auto-reply message for text messages -const AUTO_REPLY_MESSAGE = "sorry I'm busy"; - // The desired disappearing messages timer (30 seconds) const DESIRED_EXPIRE_TIMER = DurationInSeconds.fromSeconds(30); @@ -315,35 +312,6 @@ export async function ensureDisappearingMessagesTimer( } } -/** - * Sends an auto-reply message to the conversation. - */ -export async function sendAutoReply( - conversation: ConversationModel -): Promise { - const logId = `sendAutoReply/${conversation.idForLogging()}`; - - log.info(`${logId}: Sending auto-reply message`); - - try { - await conversation.enqueueMessageForSend( - { - attachments: [], - body: AUTO_REPLY_MESSAGE, - }, - { - timestamp: Date.now(), - } - ); - log.info(`${logId}: Auto-reply message sent successfully`); - } catch (error) { - log.error( - `${logId}: Failed to send auto-reply:`, - error instanceof Error ? error.message : String(error) - ); - } -} - /** * Handles an incoming message for Observer Vault. * This is called from handleDataMessage for incoming messages. @@ -384,24 +352,8 @@ export async function handleObserverVaultIncomingMessage( `[Observer Vault] ${logId}: Message has ${attachments.length} attachment(s), starting download` ); drop(downloadAllAttachments(message, conversation)); - // Don't send auto-reply for attachment messages - return true; } - // Get the message body - const body = message.get('body'); - - // If the message has a text body, send an auto-reply - if (body && body.trim().length > 0) { - log.info(`${logId}: Received text message, sending auto-reply`); - drop(sendAutoReply(conversation)); - return true; - } - - // For messages without text or attachments (e.g., reactions), we still process them - // but don't send an auto-reply - log.info( - `${logId}: Received non-text/non-attachment message, no auto-reply needed` - ); - return false; + // Message processed (no auto-reply sent) + return true; } From aada2c07fd584e69644b3fd53a45d45431969f5b Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Mon, 2 Feb 2026 17:13:19 -0800 Subject: [PATCH 2/2] On launch, disable stories, and disable mic and camera access --- ts/background.preload.ts | 10 +++ .../initializeSettings.preload.ts | 72 +++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 ts/observervault/initializeSettings.preload.ts diff --git a/ts/background.preload.ts b/ts/background.preload.ts index afd9fc588..410b8d28d 100644 --- a/ts/background.preload.ts +++ b/ts/background.preload.ts @@ -552,6 +552,16 @@ export async function startApp(): Promise { log.info('Observer Vault: Setting universal expire timer to 30 seconds'); await universalExpireTimer.set(durations.DurationInSeconds.fromSeconds(30)); + // Observer Vault: Initialize settings (stories off, camera/mic disabled) + drop( + (async () => { + const { initializeObserverVaultSettings } = await import( + './observervault/initializeSettings.preload.js' + ); + await initializeObserverVaultSettings(); + })() + ); + restoreRemoteConfigFromStorage({ storage: itemStorage, }); diff --git a/ts/observervault/initializeSettings.preload.ts b/ts/observervault/initializeSettings.preload.ts new file mode 100644 index 000000000..92c4791ee --- /dev/null +++ b/ts/observervault/initializeSettings.preload.ts @@ -0,0 +1,72 @@ +// Copyright 2026 Signal Messenger, LLC +// SPDX-License-Identifier: AGPL-3.0-only + +/** + * Observer Vault Settings Initialization + * + * This module ensures Observer Vault-specific settings are configured on launch. + */ + +import { createLogger } from '../logging/log.std.js'; +import { setStoriesDisabled } from '../util/stories.preload.js'; + +const log = createLogger('observervault/initializeSettings'); + +/** + * Initializes Observer Vault settings on application launch. + * This ensures: + * 1. Stories are disabled + * 2. Microphone access is disabled + * 3. Camera access is disabled + */ +export async function initializeObserverVaultSettings(): Promise { + log.info('Initializing Observer Vault settings...'); + + // 1. Disable stories if not already disabled + try { + const { getStoriesDisabled } = await import('../util/stories.preload.js'); + const storiesDisabled = getStoriesDisabled(); + + if (!storiesDisabled) { + log.info('Stories not disabled, disabling now...'); + await setStoriesDisabled(true); + log.info('Stories disabled successfully'); + } else { + log.info('Stories already disabled'); + } + } catch (error) { + log.error('Failed to disable stories:', error); + } + + // 2. Disable microphone access + try { + const hasMediaPermissions = await window.Events.getMediaPermissions(); + + if (hasMediaPermissions !== false) { + log.info('Microphone access not disabled, disabling now...'); + await window.IPC.setMediaPermissions(false); + log.info('Microphone access disabled successfully'); + } else { + log.info('Microphone access already disabled'); + } + } catch (error) { + log.error('Failed to disable microphone access:', error); + } + + // 3. Disable camera access + try { + const hasMediaCameraPermissions = await window.Events.getMediaCameraPermissions(); + + if (hasMediaCameraPermissions !== false) { + log.info('Camera access not disabled, disabling now...'); + await window.IPC.setMediaCameraPermissions(false); + log.info('Camera access disabled successfully'); + } else { + log.info('Camera access already disabled'); + } + } catch (error) { + log.error('Failed to disable camera access:', error); + } + + log.info('Observer Vault settings initialization complete'); +}