Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix old stickers #13901

Merged
merged 1 commit into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -44,7 +44,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