From f9052d7ecf024ead56b962d7cce1f1f8adf51fb8 Mon Sep 17 00:00:00 2001 From: Teknium Date: Sat, 21 Mar 2026 17:56:12 -0700 Subject: [PATCH] fix(signal): use id instead of attachmentId in getAttachment RPC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cherry-picked from PR #2365 by @xerpert. Three bugs preventing Signal image attachments from being processed: 1. signal-cli getAttachment RPC expects 'id', not 'attachmentId' 2. signal-cli daemon returns dict {"data": "base64..."} not raw base64 3. MessageType.IMAGE doesn't exist — correct enum is MessageType.PHOTO --- gateway/platforms/signal.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gateway/platforms/signal.py b/gateway/platforms/signal.py index 4bedf4b07..79ccb551b 100644 --- a/gateway/platforms/signal.py +++ b/gateway/platforms/signal.py @@ -478,7 +478,7 @@ class SignalAdapter(BasePlatformAdapter): if any(mt.startswith("audio/") for mt in media_types): msg_type = MessageType.VOICE elif any(mt.startswith("image/") for mt in media_types): - msg_type = MessageType.IMAGE + msg_type = MessageType.PHOTO # Parse timestamp from envelope data (milliseconds since epoch) ts_ms = envelope_data.get("timestamp", 0) @@ -519,6 +519,13 @@ class SignalAdapter(BasePlatformAdapter): if not result: return None, "" + # Handle dict response (signal-cli returns {"data": "base64..."}) + if isinstance(result, dict): + result = result.get("data") + if not result: + logger.warning("Signal: attachment response missing 'data' key") + return None, "" + # Result is base64-encoded file content raw_data = base64.b64decode(result) ext = _guess_extension(raw_data)