Skip to content

fix(signal): use media_urls/media_types in MessageEvent construction#871

Merged
teknium1 merged 1 commit intomainfrom
hermes/hermes-3d744afd
Mar 10, 2026
Merged

fix(signal): use media_urls/media_types in MessageEvent construction#871
teknium1 merged 1 commit intomainfrom
hermes/hermes-3d744afd

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

Problem

The Signal adapter was passing image_paths, audio_path, and document_paths kwargs to MessageEvent.__init__(), but those fields don't exist on the dataclass. This causes:

TypeError: MessageEvent.__init__() got an unexpected keyword argument 'image_paths'

Reported by alphakamp.

Root Cause

MessageEvent (in gateway/platforms/base.py) uses media_urls: List[str] and media_types: List[str] for media attachments. The Signal adapter was using its own non-standard field names that don't match the interface used by Discord, Slack, Telegram, and WhatsApp adapters.

Fix

  • Replaced separate image_paths, audio_path, document_paths variables with unified media_urls and media_types lists (consistent with all other adapters)
  • Added _ext_to_mime() helper to map file extensions to MIME types
  • Uses Signal's contentType from attachment metadata when available, falling back to extension-based mapping
  • Updated message type detection to check media_types prefixes (audio/, image/)

Testing

All 493 gateway tests pass. All 35 signal-specific tests pass.

…_paths/audio_path/document_paths

The Signal adapter was passing image_paths, audio_path, and document_paths
to MessageEvent.__init__(), but those fields don't exist on the dataclass.
MessageEvent uses media_urls (List[str]) and media_types (List[str]).

Changes:
- Replace separate image_paths/audio_path/document_paths with unified
  media_urls and media_types lists (matching Discord, Slack, etc.)
- Add _ext_to_mime() helper to map file extensions to MIME types
- Use Signal's contentType from attachment metadata when available,
  falling back to extension-based mapping
- Update message type detection to check media_types prefixes

Fixes TypeError: MessageEvent.__init__() got an unexpected keyword
argument 'image_paths'
@teknium1 teknium1 merged commit 53be6af into main Mar 10, 2026
1 check passed
@teknium1
Copy link
Copy Markdown
Contributor Author

Merged to main via 53be6af.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant