[#11113] Can't send image without description in 1-1 and group chats

This commit is contained in:
andrey 2020-08-27 14:59:47 +02:00
parent 2901f4c7cf
commit 0cb554f5c6
No known key found for this signature in database
GPG Key ID: 89B67245FD2F0272
1 changed files with 17 additions and 15 deletions

View File

@ -103,6 +103,8 @@
([text users-fn]
(replace-mentions text users-fn 0))
([text users-fn idx]
(if (string/blank? text)
text
(let [mention-key-idx (string/index-of text "@" idx)]
(if-not mention-key-idx
text
@ -117,7 +119,7 @@
(subs text (+ (inc mention-key-idx)
(count alias)))])
mention-end (+ (inc mention-key-idx) (count public-key))]
(recur new-text (fn [] users) mention-end))))))))
(recur new-text (fn [] users) mention-end)))))))))
(defn check-mentions [cofx text]
(replace-mentions text #(get-mentionable-users cofx)))