orbitalimpact / hipmost

Migrate your Hipchat history to Mattermost
MIT License
10 stars 5 forks source link

Skip message type: TopicRoomMessage and ArchiveRoomMessage #1

Closed lrizzi closed 6 years ago

lrizzi commented 6 years ago

TopicRoomMessage and ArchiveRoomMessage message type need to be skipped otherwise you get the undefined method error during the import, topics and archived state are not handle by mattermost bulk import.

/usr/lib64/ruby/gems/2.1.0/gems/hipmost-0.1.0/lib/hipmost/hipchat/post.rb:7:in `initialize': undefined method `[]' for nil:NilClass (NoMethodError)
        from /usr/lib64/ruby/gems/2.1.0/gems/hipmost-0.1.0/lib/hipmost/hipchat/post_repository.rb:32:in `new'
        from /usr/lib64/ruby/gems/2.1.0/gems/hipmost-0.1.0/lib/hipmost/hipchat/post_repository.rb:32:in `block in load'
        from /usr/lib64/ruby/gems/2.1.0/gems/hipmost-0.1.0/lib/hipmost/hipchat/post_repository.rb:27:in `each'
        from /usr/lib64/ruby/gems/2.1.0/gems/hipmost-0.1.0/lib/hipmost/hipchat/post_repository.rb:27:in `load'
        from /usr/lib64/ruby/gems/2.1.0/gems/hipmost-0.1.0/lib/hipmost/cmds/room.rb:76:in `tap'
        from /usr/lib64/ruby/gems/2.1.0/gems/hipmost-0.1.0/lib/hipmost/cmds/room.rb:76:in `block (2 levels) in save'
        from /usr/lib64/ruby/gems/2.1.0/gems/hipmost-0.1.0/lib/hipmost/cmds/room.rb:70:in `each'
        from /usr/lib64/ruby/gems/2.1.0/gems/hipmost-0.1.0/lib/hipmost/cmds/room.rb:70:in `block in save'
        from /usr/lib64/ruby/gems/2.1.0/gems/hipmost-0.1.0/lib/hipmost/cmds/room.rb:50:in `open'
        from /usr/lib64/ruby/gems/2.1.0/gems/hipmost-0.1.0/lib/hipmost/cmds/room.rb:50:in `save'
        from /usr/lib64/ruby/gems/2.1.0/gems/hipmost-0.1.0/lib/hipmost/cmds/room.rb:43:in `import'
        from /usr/lib64/ruby/gems/2.1.0/gems/hipmost-0.1.0/lib/hipmost/cmds/room.rb:19:in `run'
        from /usr/lib64/ruby/gems/2.1.0/gems/hipmost-0.1.0/lib/hipmost.rb:12:in `run'
        from /usr/lib64/ruby/gems/2.1.0/gems/hipmost-0.1.0/exe/hipmost:48:in `<top (required)>'
        from /usr/bin/hipmost:23:in `load'
        from /usr/bin/hipmost:23:in `<main>'
ylluminarious commented 6 years ago

@lrizzi Thanks for the contribution! This looks good to me, I'll go ahead and merge. Ping @gabrielrios