Skip to content

Commit

Permalink
Core: old invite codes ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
klauswuestefeld committed Sep 25, 2015
1 parent 2cf1092 commit 1bfe4a1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/src/main/clojure/sneer/convo.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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))))

Expand Down

0 comments on commit 1bfe4a1

Please sign in to comment.