diff --git a/src/tattler/core.clj b/src/tattler/core.clj index 4259bd9..ef2be51 100644 --- a/src/tattler/core.clj +++ b/src/tattler/core.clj @@ -21,19 +21,14 @@ (defn listen! [& {app :app mqtt-client :mqtt-client topic :topic logger :logger}] (let [note-chan (mqtt/subscribe! mqtt-client topic)] - (go-loop [note ( note :urgency (keyword)) - }) - (let [err (humanize (t/explain Notification note))] - (log/error! logger (format "rejecting invalid notification: %s (%s)\n%s" - (:summary err) (:body err) - (pprint-to-string note))))) - (recur ( note-msg :payload (update :urgency keyword))] + (if (t/validate Notification note) + (notify/send-notification! mqtt-client (assoc note :app app)) + (let [err (humanize (t/explain Notification note))] + (log/error! logger (format "rejecting invalid notification: %s (%s)\n%s" + (:summary err) (:body err) + (pprint-to-string note))))) + (recur (