diff --git a/notify-mail.hy b/notify-mail.hy index e60e099..3060aad 100755 --- a/notify-mail.hy +++ b/notify-mail.hy @@ -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))))))