twitter.rb 654 B

1234567891011121314151617181920212223242526272829
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Sequencer::Unit::Import::Kayako::Post::Channel::Twitter < Sequencer::Unit::Import::Kayako::Post::Channel::Base
  3. def mapping
  4. super.merge(
  5. message_id: original_post['id'],
  6. to: to,
  7. body: original_post['contents'],
  8. )
  9. end
  10. private
  11. def article_type_name
  12. return 'twitter direct-message' if original_post['resource_type'] == 'twitter_message'
  13. 'twitter status'
  14. end
  15. def identify_key
  16. 'screen_name'
  17. end
  18. def to
  19. return if original_post['recipient'].nil?
  20. original_post['recipient'][identify_key]
  21. end
  22. end