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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user