diff options
Diffstat (limited to 'fancy_bear/contextio/message.rb')
| -rw-r--r-- | fancy_bear/contextio/message.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/fancy_bear/contextio/message.rb b/fancy_bear/contextio/message.rb index bae9be4..abf4a09 100644 --- a/fancy_bear/contextio/message.rb +++ b/fancy_bear/contextio/message.rb @@ -25,8 +25,23 @@ module FancyBear messages end - def get + def get(id) + output = {} + message = @account.messages.where(:message_id => id).first + output['from_address'] = message.from['email'] + output['from_name'] = message.from['name'] + output['subject'] = message.subject + output['timestamp'] = message.date + output['labels'] = message.folders + + message.body_parts.each do |p| + if p.content + output['html'] = p.html? + output['content'] = p.content + end + end + output end end |
