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)]
|
contacts)]
|
||||||
(:ref (get available-commands-responses response-name))))
|
(:ref (get available-commands-responses response-name))))
|
||||||
|
|
||||||
(defn- emoji-only-string?
|
(defn- emoji-only-content?
|
||||||
[text]
|
[content]
|
||||||
(re-matches constants/regx-emoji text))
|
(and (string? content) (re-matches constants/regx-emoji content)))
|
||||||
|
|
||||||
(defn- prepare-message
|
(defn- prepare-message
|
||||||
[message chat-id current-chat?]
|
[{:keys [content] :as message} chat-id current-chat?]
|
||||||
(cond-> (assoc message :appearing? true)
|
(cond-> (assoc message :appearing? true)
|
||||||
(not current-chat?) (assoc :appearing? false)
|
(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
|
(defn- add-message
|
||||||
[chat-id {:keys [message-id clock-value content] :as message} current-chat? {:keys [db]}]
|
[chat-id {:keys [message-id clock-value content] :as message} current-chat? {:keys [db]}]
|
||||||
|
|
Loading…
Reference in New Issue