From 1bfe4a164b82f1ff7fb7f75c2986248224aa818d Mon Sep 17 00:00:00 2001 From: Klaus Wuestefeld Date: Fri, 25 Sep 2015 14:31:17 -0300 Subject: [PATCH] Core: old invite codes ignored --- core/src/main/clojure/sneer/convo.clj | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/src/main/clojure/sneer/convo.clj b/core/src/main/clojure/sneer/convo.clj index a96606bc2..b462d00ac 100644 --- a/core/src/main/clojure/sneer/convo.clj +++ b/core/src/main/clojure/sneer/convo.clj @@ -93,8 +93,13 @@ ; SessionSummary(long id, String type, String title, String date, String unread) ; ChatMessage(long id, String text, boolean isOwn, String date) (defn- to-foreign [own-puk {:keys [id nick invite-code messages sessions]}] - (let [pretty-time (time/pretty-printer)] - (Convo. id nick (encode-invite own-puk invite-code) + (let [pretty-time (time/pretty-printer) + invite (if (seq messages) ;Some contacts from old versions, for some reason, still have a pending invite code even after they have messages. In those cases we ignore the invite code. + nil + (encode-invite own-puk invite-code))] + (Convo. id + nick + invite (->ChatMessageList messages pretty-time) (->SessionSummaryList sessions pretty-time))))