Ensure version compatibility

This commit is contained in:
janherich 2018-10-02 12:16:23 +02:00
parent d49628f648
commit 12021554f3
No known key found for this signature in database
GPG Key ID: C23B473AFBE94D13
1 changed files with 7 additions and 4 deletions

View File

@ -46,9 +46,12 @@
(deftype MessageHandler [] (deftype MessageHandler []
Object Object
(tag [this v] "c7") (tag [this v] "c4")
(rep [this {:keys [content content-type message-type clock-value timestamp]}] (rep [this {:keys [content content-type message-type clock-value timestamp]}]
#js [content content-type message-type clock-value timestamp])) (if (= content-type constants/text-content-type)
;; append new content add the end, still pass content the old way at the old index
#js [(:text content) content-type message-type clock-value timestamp content]
#js [content content-type message-type clock-value timestamp content])))
(deftype MessagesSeenHandler [] (deftype MessagesSeenHandler []
Object Object
@ -102,8 +105,8 @@
(v1.contact/ContactRequest. name profile-image address fcm-token)) (v1.contact/ContactRequest. name profile-image address fcm-token))
"c3" (fn [[name profile-image address fcm-token]] "c3" (fn [[name profile-image address fcm-token]]
(v1.contact/ContactRequestConfirmed. name profile-image address fcm-token)) (v1.contact/ContactRequestConfirmed. name profile-image address fcm-token))
"c4" (fn [[content content-type message-type clock-value timestamp]] "c4" (fn [[legacy-content content-type message-type clock-value timestamp content]]
(v1.protocol/Message. (safe-content-parse content-type content) content-type message-type clock-value timestamp)) (v1.protocol/Message. (safe-content-parse content-type (or content legacy-content)) content-type message-type clock-value timestamp))
"c7" (fn [[content content-type message-type clock-value timestamp]] "c7" (fn [[content content-type message-type clock-value timestamp]]
(v1.protocol/Message. (safe-content-parse content-type content) content-type message-type clock-value timestamp)) (v1.protocol/Message. (safe-content-parse content-type content) content-type message-type clock-value timestamp))
"c5" (fn [message-ids] "c5" (fn [message-ids]