From 12021554f3029a488e6c5137e3e0fd8cefb7fb2d Mon Sep 17 00:00:00 2001 From: janherich Date: Tue, 2 Oct 2018 12:16:23 +0200 Subject: [PATCH] Ensure version compatibility --- src/status_im/transport/message/transit.cljs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/status_im/transport/message/transit.cljs b/src/status_im/transport/message/transit.cljs index b5f7939081..a3c2044fe9 100644 --- a/src/status_im/transport/message/transit.cljs +++ b/src/status_im/transport/message/transit.cljs @@ -46,9 +46,12 @@ (deftype MessageHandler [] Object - (tag [this v] "c7") + (tag [this v] "c4") (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 [] Object @@ -102,8 +105,8 @@ (v1.contact/ContactRequest. name profile-image address fcm-token)) "c3" (fn [[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]] - (v1.protocol/Message. (safe-content-parse content-type 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 (or content legacy-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)) "c5" (fn [message-ids]