Merge pull request #424 from status-im/bug/#421
Fix for inconsistent gap between messages (#421)
This commit is contained in:
commit
0a33da12be
|
@ -398,7 +398,7 @@
|
|||
(fn [db [_ {:keys [chat-id clock-value] :as opts}]]
|
||||
(let [chat (if (chats/exists? chat-id)
|
||||
(let [{old-clock-value :clock-value :as chat} (chats/get-by-id chat-id)]
|
||||
(assoc chat :clock-value (+ (max old-clock-value clock-value)) 1))
|
||||
(assoc chat :clock-value (max old-clock-value clock-value)))
|
||||
(prepare-chat db chat-id opts))]
|
||||
(chats/save chat)
|
||||
(update-in db [:chats chat-id] merge chat))))
|
||||
|
|
|
@ -211,8 +211,8 @@
|
|||
:keypair {:public public-key
|
||||
:private private-key})))
|
||||
(protocol/send-message! (assoc-in options
|
||||
[:message :to] (:to message))))
|
||||
(dispatch [:inc-clock chat-id]))))))
|
||||
[:message :to] (:to message))))))
|
||||
(dispatch [:inc-clock chat-id]))))
|
||||
|
||||
(register-handler ::send-command-protocol!
|
||||
(u/side-effect!
|
||||
|
@ -235,5 +235,5 @@
|
|||
:keypair {:public public-key
|
||||
:private private-key}))
|
||||
(protocol/send-message! (assoc-in options
|
||||
[:message :to] chat-id)))
|
||||
(dispatch [:inc-clock chat-id])))))))
|
||||
[:message :to] chat-id)))))
|
||||
(dispatch [:inc-clock chat-id])))))
|
||||
|
|
Loading…
Reference in New Issue