conversations.js 923 B

12345678910111213141516171819202122232425262728
  1. module.exports.name = 'conversations'
  2. module.exports.description = 'List all SMS and iMessage conversations'
  3. // Specify this reporter requires a backup.
  4. // The second parameter to func() is now a backup instead of the path to one.
  5. module.exports.requiresBackup = true
  6. // Specify this reporter supports the promises API for allowing chaining of reports.
  7. module.exports.usesPromises = true
  8. module.exports.func = function (program, backup, resolve, reject) {
  9. backup.getConversations()
  10. .then((items) => {
  11. var result = program.formatter.format(items, {
  12. program: program,
  13. columns: {
  14. 'ID': el => el.ROWID,
  15. 'Date': el => el.XFORMATTEDDATESTRING || '??',
  16. 'Service': el => el.service_name + '',
  17. 'Chat Name': el => el.chat_identifier + '',
  18. 'Display Name': el => el.display_name + ''
  19. }
  20. })
  21. resolve(result)
  22. })
  23. .catch(reject)
  24. }