Skip to content

MMS support#828

Open
whiteboxsolutions wants to merge 28 commits intoNdoleStudio:mainfrom
whiteboxsolutions:mms-support
Open

MMS support#828
whiteboxsolutions wants to merge 28 commits intoNdoleStudio:mainfrom
whiteboxsolutions:mms-support

Conversation

@whiteboxsolutions
Copy link

@whiteboxsolutions whiteboxsolutions commented Feb 27, 2026

Implementation for: #262

@CLAassistant
Copy link

CLAassistant commented Feb 27, 2026

CLA assistant check
All committers have signed the CLA.

@whiteboxsolutions
Copy link
Author

Will run through E2E testing tomorrow to confirm everything is working as intended

@what-the-diff
Copy link

what-the-diff bot commented Feb 27, 2026

PR Summary

  • Added SMS/MMS Capability: This request includes a new functionality that lets our users send Multimedia Messaging Service (MMS) messages. This includes, for example, pictures or videos along with the typical text-only Short Message Service (SMS). It's been accomplished through a newly added dependency in build.gradle and necessary updates in various components and services such as FirebaseMessagingService.kt, HttpSmsApiService.kt, Message.kt, Attachment.kt, SentReceiver.kt and SmsManagerService.kt.

  • Introduced Attachment Handling: A new Attachment field was added to the messages so they can carry attached files. Moreover, the code for downloading attachments has been introduced that ensures these attachments do not exceed 1.5MB in size to avoid any overloading issues. A cleanup logic for file handling after message sending is also added.

  • Updated Validations: This includes enhancements to message validations to make sure the numbers and types of attachments are acceptable. This will ensure no more than 10 files are attached to a single message and the format and content types are safe and accepted. To achieve this, changes are made in various validator files.

  • User Interface (UI) Updates: Made minor enhancements in form error handling and feedback, particularly for attachments, to guide the user when sending the message. Vue components MessageThread.vue and index.vue have been updated to display multimedia messages and let users input attachment URLs.

  • Attachment URL Checks: Introduced a new functionality that checks attachment URLs for reachability and verifies their size and scheme. This ensures the attachments user wants to send are available and accessible, providing a seamless MMS sending experience.

Overall, this PR focuses on enhancing the messaging capabilities of our service, enabling users to send multimedia messages, along with maintaining the optimum performance by controlling the size of attachments.

@whiteboxsolutions
Copy link
Author

Tested and working!

image

MMS attachments can be added via URLs (up to 10) as long as the attachments do not exceed 1.5MB due to carrier limits.

@whiteboxsolutions whiteboxsolutions marked this pull request as ready for review March 1, 2026 04:43
@greptile-apps
Copy link

greptile-apps bot commented Mar 1, 2026

Greptile Summary

This PR adds MMS (Multimedia Messaging Service) support to the httpSMS application, enabling users to send messages with attachments like images and videos.

Key Changes:

  • Android app downloads attachments, generates MMS PDU using android-smsmms library, and sends via native MMS service
  • API validates attachment URLs (up to 10 per message, 1.5MB each) with caching and adds attachment fields to message entities
  • Web UI provides textarea for comma-separated attachment URLs with image preview support
  • Attachment content types are inferred from file extensions across multiple components

Issues Found:

  • Missing Content-Length header allows oversized files to download fully before rejection
  • 24-hour error caching prevents retry after temporary network issues resolve
  • Content type inference logic duplicated in 3+ locations
  • Sequential URL validation could be slow for multiple attachments

Confidence Score: 3/5

  • Safe to merge with moderate risk - functional but has efficiency issues
  • The implementation is functionally sound but has two logic issues: (1) missing Content-Length headers allow full download of oversized files, and (2) long error cache TTL prevents retry of temporarily failed URLs. Code duplication and sequential validation affect maintainability and performance but not correctness.
  • Pay close attention to android/app/src/main/java/com/httpsms/HttpSmsApiService.kt and api/pkg/validators/validator.go for the download and caching logic issues

Important Files Changed

Filename Overview
android/app/src/main/java/com/httpsms/FirebaseMessagingService.kt Added MMS handling with PDU generation, attachment download, and encryption support
android/app/src/main/java/com/httpsms/HttpSmsApiService.kt Added attachment download with 1.5MB limit; missing Content-Length could cause oversized downloads
api/pkg/requests/bulk_message_request.go Added CSV attachment URL support with content type inference; duplicated logic
api/pkg/validators/message_handler_validator.go Added attachment validation with 10-file limit, URL format checks, and remote validation
api/pkg/validators/validator.go Added URL validation with HEAD request and caching; 24-hour error cache may be too long
web/pages/messages/index.vue Added UI for comma-separated attachment URLs with client-side content type inference

Sequence Diagram

sequenceDiagram
    participant User
    participant Web/Discord
    participant API
    participant Validator
    participant Android
    participant AttachmentServer
    participant MMS

    User->>Web/Discord: Send message with attachment URLs
    Web/Discord->>API: POST /v1/messages/send
    API->>Validator: Validate attachment URLs
    Validator->>AttachmentServer: HEAD request (check size)
    AttachmentServer-->>Validator: Content-Length header
    Validator->>Validator: Cache result (24h TTL)
    Validator-->>API: Validation result
    API->>API: Store message with attachments
    API->>Android: Push notification via FCM
    Android->>AttachmentServer: Download attachments
    AttachmentServer-->>Android: File data
    Android->>Android: Build MMS PDU with attachments
    Android->>Android: Write PDU to cache file
    Android->>MMS: sendMultimediaMessage(pduUri)
    MMS-->>Android: Broadcast (success/failure)
    Android->>Android: Cleanup PDU file
    Android->>API: Report status
Loading

Last reviewed commit: 47dde30

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

24 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

return null
}

val maxSizeBytes = 1.5 * 1024 * 1024 // most (modern?) carriers have a 2MB limit, so targetting 1.5MB should be safe
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Magic number duplicated in api/pkg/validators/validator.go:203. Consider defining as a constant in a shared location.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@whiteboxsolutions whiteboxsolutions changed the title WIP: Mms support MMS support Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants