diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-10-10 16:29:20 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-10-10 16:29:20 +0200 |
| commit | 7957fa686eb6e8cf57bcb62ff4e6d2785693030b (patch) | |
| tree | 562195088fa40bc4db85193956bdd8aaf00e31f5 /packages/meshbay-hub/src/meshbay_hub/static/drive-sync.js | |
| parent | 24547e4efd3a45b36b3bea8c29cfc687230a6d3a (diff) | |
| download | meshbay-7957fa686eb6e8cf57bcb62ff4e6d2785693030b.tar.gz | |
feat(android): back up WhatsApp's own chat backups, and its media if asked
A WhatsApp section takes WhatsApp's folder through the picker, sends its
encrypted Databases and Backups (not the dated copies of earlier weeks) into
<folder>/<account>-whatsapp, and names the restore set in the manifest.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/drive-sync.js')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/static/drive-sync.js | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/drive-sync.js b/packages/meshbay-hub/src/meshbay_hub/static/drive-sync.js index 5ddf188..3887e4f 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/drive-sync.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/drive-sync.js @@ -1,4 +1,4 @@ -// Files backup: the folders the person chose through the system's picker, +// Files and WhatsApp backups: folders chosen through the system's picker, // sent into `<folder>/<account>-drive/<chosen folder>/…` of the destination // every backup shares (sync-destination.js), once a day, on an unmetered // network, like photos (docs/MESHBAY_DESIGN.md §9.13). @@ -23,7 +23,26 @@ const drive = createBackup({ say: (code) => t('phonesync.notice', { what: t('drivesync.heading'), reason: failureText(code) }), }); -export const startDriveSync = (context) => drive.start(context); -export const stopDriveSync = () => drive.stop(); +// WhatsApp's own folder: the same runner over its bridge, into +// `<folder>/<account>-whatsapp/` (DriveKind.kt says what is sent). +const whatsapp = createBackup({ + name: 'WhatsApp', + sync: platform.whatsappSync, + configured: (status) => Boolean(status.on) && (status.folders || []).length > 0, + progress: 'whatsappsync.notif_progress', + failures: LASTING, + say: (code) => t('phonesync.notice', { what: t('whatsappsync.heading'), reason: failureText(code) }), +}); + +export function startDriveSync(context) { + drive.start(context); + whatsapp.start(context); +} +export function stopDriveSync() { + drive.stop(); + whatsapp.stop(); +} export const runDriveSync = (opts) => drive.run(opts); export const subscribe = (fn) => drive.subscribe(fn); +export const runWhatsAppSync = (opts) => whatsapp.run(opts); +export const subscribeWhatsApp = (fn) => whatsapp.subscribe(fn); |