Merge pull request #2400 from NousResearch/hermes/hermes-5d6932ba
fix(signal): use id instead of attachmentId in getAttachment RPC
This commit is contained in:
commit
a0f411c87d
1 changed files with 8 additions and 1 deletions
|
|
@ -478,7 +478,7 @@ class SignalAdapter(BasePlatformAdapter):
|
||||||
if any(mt.startswith("audio/") for mt in media_types):
|
if any(mt.startswith("audio/") for mt in media_types):
|
||||||
msg_type = MessageType.VOICE
|
msg_type = MessageType.VOICE
|
||||||
elif any(mt.startswith("image/") for mt in media_types):
|
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)
|
# Parse timestamp from envelope data (milliseconds since epoch)
|
||||||
ts_ms = envelope_data.get("timestamp", 0)
|
ts_ms = envelope_data.get("timestamp", 0)
|
||||||
|
|
@ -519,6 +519,13 @@ class SignalAdapter(BasePlatformAdapter):
|
||||||
if not result:
|
if not result:
|
||||||
return None, ""
|
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
|
# Result is base64-encoded file content
|
||||||
raw_data = base64.b64decode(result)
|
raw_data = base64.b64decode(result)
|
||||||
ext = _guess_extension(raw_data)
|
ext = _guess_extension(raw_data)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue