Skip to content

Conversation

@ljrk0
Copy link

@ljrk0 ljrk0 commented Jan 23, 2026

Type of change(s)

  • Bug fix
  • Feature / enhancement
  • Infrastructure / tooling (CI, build, deps, tests)
  • Documentation

What changed and why

  • Fix logic of includeTextOnlyAttachment flag in MMS export
  • Implement includeTextOnlyMMSasSMS flag for SMS export
  • Hook up both flags to actual exporting process

Note: This is just a proposed feature/implementation. If the current behavior is to be kept (despite being superficially confusing), I'd propose removing the logic around includeTextOnlyAttachment entirely as it's not used. In addition, one could forego the entire split of "export MMS/SMS only" and always export all data. My PR tries to match most closely to what perhaps was intended, not necessarily what is "best".

Tests performed

  • I did combined exports (SMS as SMS, MMS as MMS), SMS-only (SMS as SMS, text only MMS as SMS) and MMS-only (non-text-only MMS as MMS) and checked the results

Checklist

  • I read the contribution guidelines.
  • I manually tested my changes on device/emulator (if applicable).
  • [-] I updated the "Unreleased" section in CHANGELOG.md (if applicable).
  • I have self-reviewed my pull request (no typos, formatting errors, etc.).
  • All checks are passing.

ljrk0 added 5 commits January 23, 2026 00:34
Otherwise the queryCursor will fail silently (since showErrors = false) with the exception

    column 'sub' does not exist. Available columns: [_id, creator, ct_t, d_rpt, date, date_sent, locked, m_type, msg_box, read, rr, seen, text_only, st, sub_cs, sub_id, tr_id]

and will return no results at all.
Currently, the flag `includeTextOnlyAttachment` is never used in the export logic, despite being of useful value: Some MMS aren't immediately visible to users
as such (e.g., very long "SMS" messages are often sent as MMS). Users wanting to only export "true" MMS (images, etc.), may be confused as to why "SMS" are
included in the export. As such, introduce a logic to set this flag if only MMS export is checked, otherwise export them as-is.

Similarly, users exporting SMS only may be missing these exact messages. Analogously, introduce a new flag `includeTextOnlyMMSasSMS` for SMS export, that
is suppoed to export long MMS "as SMS".
This effectively converts MMS that are "text only" to SMS as part of the export process. Property values from MMS are converted to equivalents in SMS.
This flag behaved oddly, as text only attachments were *always* included, even if it is not set. However, setting it, would filter the MMS results for those MMS
exclusively, that had TEXT_ONLY set. This old behavior would've been better described by "onlyIncludeTextOnlyAttachments".

In addition, however, the logic is flawed as TEXT_ONLY is a property set by the PduPersister when receiving MMS. If the MMS wasn't processed by the Persister,
the default value of the table row, 0, is set. This is quite often the case (in my case, all MMS were thus set to be non-text-only, despite being very much
text-only). The AOSP source code also mentions that this is only a UI hint.

For exports, we thus re-implement the same logic and check whether MMS messages are indeed "text only" or not.
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.

1 participant