lib/namespace.rb in inbox-0.15.3 vs lib/namespace.rb in inbox-0.15.4
- old
+ new
@@ -116,10 +116,15 @@
start_cursor = json["cursor_start"]
end_cursor = json["cursor_end"]
json["deltas"].each do |delta|
- cls = OBJECTS_TABLE[delta['object']]
+ object = delta['object']
+ if object == 'message'
+ # Drafts are messages underneath
+ object = delta['attributes']['object']
+ end
+ cls = OBJECTS_TABLE[object]
obj = cls.new(@_api, @namespace_id)
case delta["event"]
when 'create', 'modify'
obj.inflate(delta['attributes'])