@bobfrankston/rmfmail 1.0.668 → 1.0.669

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -66,6 +66,7 @@ __export(api_client_exports, {
66
66
  moveMessages: () => moveMessages,
67
67
  onEvent: () => onEvent,
68
68
  onWsEvent: () => onWsEvent,
69
+ openInTextEditor: () => openInTextEditor,
69
70
  openInWord: () => openInWord,
70
71
  openLocalPath: () => openLocalPath,
71
72
  readConfigHelp: () => readConfigHelp,
@@ -287,6 +288,9 @@ function addToDenylist(email) {
287
288
  function openLocalPath(which) {
288
289
  return ipc().openLocalPath(which);
289
290
  }
291
+ function openInTextEditor(path) {
292
+ return ipc().openInTextEditor?.(path) ?? Promise.resolve({ ok: false, opener: "none", reason: "no host" });
293
+ }
290
294
  function allowRemoteContent(type, value) {
291
295
  return ipc().allowRemoteContent(type, value);
292
296
  }
@@ -1224,7 +1228,8 @@ async function showMessage(accountId, uid, folderId, specialUse, isRetry = false
1224
1228
  if (srcBtn2) {
1225
1229
  if (msg.emlPath) {
1226
1230
  srcBtn2.hidden = false;
1227
- srcBtn2.title = msg.emlPath;
1231
+ srcBtn2.title = `${msg.emlPath}
1232
+ (click to copy path, double-click to open in default text editor)`;
1228
1233
  srcBtn2.onclick = () => {
1229
1234
  const path = currentMessage?.emlPath;
1230
1235
  if (!path)
@@ -1237,9 +1242,24 @@ async function showMessage(accountId, uid, folderId, specialUse, isRetry = false
1237
1242
  prompt("EML file path:", path);
1238
1243
  });
1239
1244
  };
1245
+ srcBtn2.ondblclick = (e) => {
1246
+ e.preventDefault();
1247
+ const path = currentMessage?.emlPath;
1248
+ if (!path)
1249
+ return;
1250
+ Promise.resolve().then(() => (init_api_client(), api_client_exports)).then((m) => m.openInTextEditor(path)).then((r) => {
1251
+ const status = document.getElementById("status-sync");
1252
+ if (status) {
1253
+ status.textContent = r?.ok ? `Opened in ${r.opener}: ${path}` : `Open failed: ${r?.reason || "unknown"}`;
1254
+ }
1255
+ }).catch((e2) => {
1256
+ console.error("[mv] openInTextEditor failed:", e2);
1257
+ });
1258
+ };
1240
1259
  } else {
1241
1260
  srcBtn2.hidden = true;
1242
1261
  srcBtn2.onclick = null;
1262
+ srcBtn2.ondblclick = null;
1243
1263
  }
1244
1264
  }
1245
1265
  const editBtn2 = document.getElementById("mv-edit-draft");