aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/platform.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/platform.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/platform.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/platform.js b/packages/meshbay-hub/src/meshbay_hub/static/platform.js
index b1a8ae9..596c327 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/platform.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/platform.js
@@ -296,6 +296,27 @@ export const driveSync = {
};
/**
+ * Backing up WhatsApp's own folder, chosen once through the picker (its
+ * encrypted chat backups, and its media if asked), like `driveSync`.
+ */
+const waBridge = bridge && bridge.whatsappSync;
+export const whatsappSync = {
+ available: Boolean(waBridge),
+ status() { return waBridge.status(); },
+ chooseFolder() { return waBridge.chooseFolder(); },
+ forgetFolder(id) { return waBridge.forgetFolder(id); },
+ configure(settings) { return waBridge.configure(settings); },
+ plan() { return waBridge.plan(); },
+ sent(token, dir, name) { return waBridge.sent(token, dir, name); },
+ manifest() { return waBridge.manifest(); },
+ manifestSent(token) { return waBridge.manifestSent(token); },
+ completed() { return waBridge.completed(); },
+ failed(code, text) { return waBridge.failed(code, text); },
+ keepAlive(on, text) { return waBridge.keepAlive(on, text); },
+ file: (token, name, size) => rangedFile('/wasync/', token, name, size),
+};
+
+/**
* Where every backup of this phone goes: one folder of a group the account
* owns and is alone in (docs/MESHBAY_DESIGN.md §9.12). Android only, like
* `photoSync`. See sync-destination.js.