2016-03-23 16:48:26 +02:00
|
|
|
(ns syng-im.db
|
|
|
|
(:require [schema.core :as s :include-macros true]))
|
|
|
|
|
|
|
|
;; schema of app-db
|
|
|
|
(def schema {:greeting s/Str})
|
|
|
|
|
|
|
|
;; initial state of app-db
|
2016-03-29 23:45:31 +03:00
|
|
|
(def app-db {:greeting "Hello Clojure in iOS and Android!"
|
|
|
|
:identity-password "replace-me-with-user-entered-password"
|
2016-03-30 15:23:37 +03:00
|
|
|
:contacts []
|
|
|
|
:chat {:current-chat-id "0x0479a5ed1f38cadfad1db6cd56c4b659b0ebe052bbe9efa950f6660058519fa4ca6be2dda66afa80de96ab00eb97a2605d5267a1e8f4c2a166ab551f6826608cdd"
|
2016-03-30 16:40:08 +03:00
|
|
|
:suggestions []
|
|
|
|
:command nil}
|
2016-03-29 23:45:31 +03:00
|
|
|
:chats {}
|
2016-04-01 18:05:55 +03:00
|
|
|
:chats-updated-signal 0
|
|
|
|
:new-group #{}})
|
2016-03-23 21:05:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
(def protocol-initialized-path [:protocol-initialized])
|
|
|
|
(def identity-password-path [:identity-password])
|
|
|
|
(def current-chat-id-path [:chat :current-chat-id])
|
2016-03-30 15:23:37 +03:00
|
|
|
(def input-suggestions-path [:chat :suggestions])
|
2016-03-30 16:40:08 +03:00
|
|
|
(def input-command-path [:chat :command])
|
2016-03-29 23:45:31 +03:00
|
|
|
(def updated-chats-signal-path [:chats-updated-signal])
|
|
|
|
(defn updated-chat-signal-path [chat-id]
|
|
|
|
[:chats chat-id :chat-updated-signal])
|
2016-04-01 18:05:55 +03:00
|
|
|
(def new-group-path [:new-group])
|
2016-04-03 19:00:40 +03:00
|
|
|
|