Skip to content

Commit

Permalink
fix old stickers (#13901)
Browse files Browse the repository at this point in the history
(cherry picked from commit 5d9bcb3)
  • Loading branch information
flexsurfer committed Aug 31, 2022
1 parent c56ebf7 commit dc449b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/status_im/chat/models/input.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,12 @@
:text (i18n/label :t/update-to-listen-audio {"locale" "en"})})))

(fx/defn send-sticker-message
[cofx {:keys [hash packID]} current-chat-id]
(when-not (or (string/blank? hash) (string/blank? packID))
[cofx {:keys [hash packID pack]} current-chat-id]
(when-not (or (string/blank? hash) (and (string/blank? packID) (string/blank? pack)))
(chat.message/send-message cofx {:chat-id current-chat-id
:content-type constants/content-type-sticker
:sticker {:hash hash
:pack (int packID)}
:pack (int (if (string/blank? packID) pack packID))}
:text (i18n/label :t/update-to-see-sticker {"locale" "en"})})))

(fx/defn send-edited-message [{:keys [db] :as cofx} text {:keys [message-id]}]
Expand Down Expand Up @@ -306,15 +306,15 @@

(fx/defn chat-send-sticker
{:events [:chat/send-sticker]}
[{{:keys [current-chat-id] :as db} :db :as cofx} {:keys [hash packID] :as sticker}]
[{{:keys [current-chat-id] :as db} :db :as cofx} {:keys [hash packID pack] :as sticker}]
(fx/merge
cofx
{:db (update db
:stickers/recent-stickers
(fn [recent]
(conj (remove #(= hash (:hash %)) recent) sticker)))
::json-rpc/call [{:method "stickers_addRecent"
:params [(int packID) hash]
:params [(int (if (string/blank? packID) pack packID)) hash]
:on-success #()}]}
(send-sticker-message sticker current-chat-id)))

Expand Down
2 changes: 1 addition & 1 deletion src/status_im/multiaccounts/update/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"Add 'url' parameter to stickers that are synchronized from other devices.
It is not sent from aanother devices but we have it in our db."
[synced-stickers stickers-from-db]
(mapv #(assoc % :url (->> (get stickers-from-db (:packID %))
(mapv #(assoc % :url (->> (get stickers-from-db (or (:packID %) (:pack %)))
(:stickers)
(filter (fn [sticker-db] (= (:hash sticker-db) (:hash %))))
(first)
Expand Down

0 comments on commit dc449b5

Please sign in to comment.