Fix notify-mail.hy

This commit is contained in:
Alexander Rosenberg 2023-05-26 13:27:43 -07:00
parent 6c6e738342
commit 4b5b0f0e1b
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

View File

@ -20,10 +20,7 @@
:text True)]
(match output
OutputType.LINES (str.splitlines result.stdout)
OutputType.JSON (let [json-root (json.loads result.stdout)]
(if (!= (len json-root) 0)
(. json-root [0] [0] [(slice None -1)])
[])))))
OutputType.JSON (json.loads result.stdout))))
(defclass Message []
(setv uid None
@ -108,7 +105,7 @@
"folder:Inbox"
:output OutputType.JSON)]
(for [msg-json json-root]
(let [msg (Message.from-json msg-json mail-root)]
(let [msg (Message.from-json (. msg-json [0] [0]) mail-root)]
(Thread.start (Thread :target notify-message
:args #(msg))))))