diff options
Diffstat (limited to 'desktop/modules/mail/Accounts.qml')
| -rw-r--r-- | desktop/modules/mail/Accounts.qml | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/desktop/modules/mail/Accounts.qml b/desktop/modules/mail/Accounts.qml index c2bc9d8..4f8b114 100644 --- a/desktop/modules/mail/Accounts.qml +++ b/desktop/modules/mail/Accounts.qml @@ -35,7 +35,7 @@ Singleton { // it is singular and the rows always sum to the header. readonly property string scope: "tag:unread and tag:inbox" - // [{ key, label, color, count, threads: [{ authors, date, subject }] }] + // [{ key, label, color, count, threads: [{ thread, authors, date, subject }] }] // count is -1 until known, and stays -1 on failure: a zero there would // read as an empty inbox. property var accounts: [] @@ -170,6 +170,7 @@ Singleton { const rows = JSON.parse(parts[1]); if (Array.isArray(rows)) { acct.threads = rows.map(r => ({ + thread: String(r.thread ?? ""), authors: String(r.authors ?? ""), date: String(r.date_relative ?? ""), subject: String(r.subject ?? "(no subject)"), @@ -206,12 +207,16 @@ Singleton { Timer { id: debounce; interval: 300; onTriggered: root.refresh() } Timer { id: respawn; interval: 5000; onTriggered: watcher.running = true } - // Launching qtmaildir. It takes no arguments, so there is nothing to tell - // it about the account or thread clicked. - Process { id: openProc; command: [`${Quickshell.env("HOME")}/bin/qtmaildir`] } - + // Launching qtmaildir, detached: a running client takes the selectors + // over its socket and the launch exits, but a first launch is the client + // itself and must not belong to a Process that the next click restarts. function openClient() { - openProc.running = false; - openProc.running = true; + Quickshell.execDetached([`${Quickshell.env("HOME")}/bin/qtmaildir`]); + } + + // An account, or a thread's newest unread message in it. mail-open.sh is + // shared with the notifications, so both open mail the same way. + function open(key, thread) { + Quickshell.execDetached([`${Quickshell.shellDir}/modules/mail/mail-open.sh`, key, thread || ""]); } } |
