Add attachment previews and attachments view

Bump version to 0.2.2

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-10-07 10:15:10 +03:00
co-authored by Copilot
parent 63ee146719
commit 5529a8f18f
20 changed files with 425 additions and 9 deletions
@@ -248,6 +248,17 @@ class EpMailPlugin : Plugin() {
}
}
@PluginMethod
fun previewAttachment(call: PluginCall) {
try {
val account = AndroidAccountVault.account()
?: throw IllegalStateException("Add a mail account before previewing attachments.")
call.resolve(AndroidMailService.previewAttachment(account, JSONObject(call.data.toString())).toJSObject())
} catch (error: Exception) {
call.reject(error.message ?: "Could not preview the attachment.")
}
}
@PluginMethod
fun openExternal(call: PluginCall) {
val raw = call.getString("url").orEmpty()