Fix emoji check

Signed-off-by: Dmitry Novotochinov <trybeee@gmail.com>
This commit is contained in:
janherich 2018-04-18 12:16:29 +02:00 committed by Dmitry Novotochinov
parent d0c471eef2
commit 1a9aada018
No known key found for this signature in database
GPG Key ID: 267674DCC86628D9
1 changed files with 6 additions and 6 deletions

View File

@ -25,15 +25,15 @@
contacts)]
(:ref (get available-commands-responses response-name))))
(defn- emoji-only-string?
[text]
(re-matches constants/regx-emoji text))
(defn- emoji-only-content?
[content]
(and (string? content) (re-matches constants/regx-emoji content)))
(defn- prepare-message
[message chat-id current-chat?]
[{:keys [content] :as message} chat-id current-chat?]
(cond-> (assoc message :appearing? true)
(not current-chat?) (assoc :appearing? false)
(emoji-only-string? (:content message)) (assoc :content-type constants/content-type-emoji)))
(emoji-only-content? content) (assoc :content-type constants/content-type-emoji)))
(defn- add-message
[chat-id {:keys [message-id clock-value content] :as message} current-chat? {:keys [db]}]