From da84d3238fd35f7614128a805e65221e72ddeb69 Mon Sep 17 00:00:00 2001 From: Jennie Lees Date: Tue, 28 Jul 2015 11:54:54 -0700 Subject: [PATCH] Support received_recent_date thread ordering. --- README.md | 4 ++++ nylas/client/restful_models.py | 1 + 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 8cdc79d3..c58b719d 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,10 @@ for thread in namespace.threads.where(starred=True): # List all threads with 'ben@nylas.com' for thread in namespace.threads.where(any_email='ben@nylas.com').items(): print thread.subject + +# List threads in order of most recently received message (excludes sent messages) +for thread in namespace.threads.where(sort='received_recent_date'): + print thread.subject ``` diff --git a/nylas/client/restful_models.py b/nylas/client/restful_models.py index 7a6e7362..a45e1feb 100644 --- a/nylas/client/restful_models.py +++ b/nylas/client/restful_models.py @@ -213,6 +213,7 @@ def messages(self): class Thread(NylasAPIObject): attrs = ["draft_ids", "id", "message_ids", "namespace_id", "object", "participants", "snippet", "subject", "subject_date", "tags", + "last_message_timestamp", "first_message_timestamp", "unread", "starred", "version", "_folders", "_labels"] collection_name = 'threads'