remove useless field in message subs

Signed-off-by: yenda <eric@status.im>
This commit is contained in:
yenda 2019-06-02 11:19:57 +02:00
parent e93906c0d9
commit 75e20a0bbd
No known key found for this signature in database
GPG Key ID: 0095623C0069DCE6
2 changed files with 1 additions and 12 deletions

View File

@ -226,7 +226,6 @@
last-in-group? (or (= :system-message message-type)
(not= from (:from previous-message))
(> (- (:timestamp previous-message) timestamp) group-ms))
same-direction? (= outgoing (:outgoing previous-message))
;; Have we seen an outgoing message already?
last-outgoing? (and (not last-outgoing-seen)
outgoing)
@ -237,7 +236,6 @@
last-in-group?)
new-message (assoc message
:display-photo? (display-photo? message)
:same-direction? same-direction?
:last-in-group? last-in-group?
:last-outgoing? last-outgoing?)]
{:stream (cond-> stream
@ -253,7 +251,7 @@
(defn messages-stream
"Enhances the messages in message sequence interspersed with datemarks
with derived stream context information, like:
`:first-in-group?`, `last-in-group?`, `:same-direction?`, `:last?` and `:last-outgoing?` flags."
`:first-in-group?`, `last-in-group?`, `:last?` and `:last-outgoing?` flags."
[ordered-messages]
(when (seq ordered-messages)
(let [initial-message (first ordered-messages)

View File

@ -38,10 +38,6 @@
(is (not (:last-outgoing? actual-m1)))
(is (:last-outgoing? actual-m2))
(is (not (:last-outgoing? actual-m3))))
(testing "it marks the message with :same-direction? when from the same author"
(is (not (:same-direction? actual-m1)))
(is (not (:same-direction? actual-m2))
(is (:same-direction? actual-m3))))
(testing "it marks messages from the same author next to another with :first-in-group?"
(is (:first-in-group? actual-m1))
(is (not (:first-in-group? actual-m2)))
@ -87,11 +83,6 @@
(is (not (:last-outgoing? actual-m2)))
(is (not (:last-outgoing? actual-m3)))
(is (not (:last-outgoing? actual-m4))))
(testing "it resets :same-direction? after a datemark"
(is (not (:same-direction? actual-m1)))
(is (not (:same-direction? actual-m2))
(is (:same-direction? actual-m3)))
(is (:same-direction? actual-m4)))
(testing "it sets :first-in-group? after a datemark"
(is (:first-in-group? actual-m1))
(is (:first-in-group? actual-m4)))