mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-28 01:16:50 +00:00
[#11113] Can't send image without description in 1-1 and group chats
This commit is contained in:
parent
2901f4c7cf
commit
0cb554f5c6
@ -103,21 +103,23 @@
|
||||
([text users-fn]
|
||||
(replace-mentions text users-fn 0))
|
||||
([text users-fn idx]
|
||||
(let [mention-key-idx (string/index-of text "@" idx)]
|
||||
(if-not mention-key-idx
|
||||
text
|
||||
(let [users (users-fn)
|
||||
{:keys [public-key alias]}
|
||||
(match-mention text users mention-key-idx)]
|
||||
(if-not alias
|
||||
(recur text (fn [] users) (inc mention-key-idx))
|
||||
(let [new-text (string/join
|
||||
[(subs text 0 (inc mention-key-idx))
|
||||
public-key
|
||||
(subs text (+ (inc mention-key-idx)
|
||||
(count alias)))])
|
||||
mention-end (+ (inc mention-key-idx) (count public-key))]
|
||||
(recur new-text (fn [] users) mention-end))))))))
|
||||
(if (string/blank? text)
|
||||
text
|
||||
(let [mention-key-idx (string/index-of text "@" idx)]
|
||||
(if-not mention-key-idx
|
||||
text
|
||||
(let [users (users-fn)
|
||||
{:keys [public-key alias]}
|
||||
(match-mention text users mention-key-idx)]
|
||||
(if-not alias
|
||||
(recur text (fn [] users) (inc mention-key-idx))
|
||||
(let [new-text (string/join
|
||||
[(subs text 0 (inc mention-key-idx))
|
||||
public-key
|
||||
(subs text (+ (inc mention-key-idx)
|
||||
(count alias)))])
|
||||
mention-end (+ (inc mention-key-idx) (count public-key))]
|
||||
(recur new-text (fn [] users) mention-end)))))))))
|
||||
|
||||
(defn check-mentions [cofx text]
|
||||
(replace-mentions text #(get-mentionable-users cofx)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user