Fix emoji check
Signed-off-by: Dmitry Novotochinov <trybeee@gmail.com>
This commit is contained in:
parent
d0c471eef2
commit
1a9aada018
|
@ -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]}]
|
||||
|
|
Loading…
Reference in New Issue