lib/api_thread.rb in nylas-3.0.0 vs lib/api_thread.rb in nylas-3.1.0

- old
+ new

@@ -39,11 +39,19 @@ folder.inflate(@folder) @folder = folder end end - def messages - @messages ||= RestfulModelCollection.new(Message, @_api, {:thread_id=>@id}) + def messages(expanded: false) + @messages ||= Hash.new do |h, is_expanded| + h[is_expanded] = \ + if is_expanded + RestfulModelCollection.new(ExpandedMessage, @_api, thread_id: @id, view: 'expanded') + else + RestfulModelCollection.new(Message, @_api, thread_id: @id) + end + end + @messages[expanded] end def drafts @drafts ||= RestfulModelCollection.new(Draft, @_api, {:thread_id=>@id}) end