orbitalimpact / hipmost

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

Private Group Messages Become Direct Messages #12

Open davidbartonau opened 6 years ago

davidbartonau commented 6 years ago

I have messages in restricted rooms that are converted into direct messages to the user themselves. The original room was:

  {
    "Room": {
      "created": "2016-03-29T03:48:30+00:00",
      "guest_access_url": null,
      "id": 2588117,
      "is_archived": false,
      "members": [
        3063160
      ],
      "name": "BA Discussion Group",
      "owner": 3063160,
      "participants": [],
      "privacy": "private",
      "topic": ""
    }
  },

The message was:

 {
    "UserMessage": {
      "attachment": null,
      "attachment_path": null,
      "id": "6035b46b-6846-465c-846f-cf49f8c151a4",
      "mentions": [
        3063160,
        3117296
      ],
      "message": "@dave can you giv me and @Sali access to the above document so we can track the issues ther. ",
      "sender": {
        "id": 3074991,
        "links": {
          "self": "https://api.hipchat.com/v2/user/3074991"
        },
        "mention_name": "Insixxx",
        "name": "Insxxx",
        "version": "B6F3C039"
      },
      "timestamp": "2018-11-01T10:38:25Z 135846",
      "type": "user"
    }
  },

And this then becomes a private message. I really don't understand why, but clearly thought has gone into this.

{ "type": "direct_post", "direct_post": { "channel_members": ["insxxx", "insxxx"], "user": "insxxx", "message": "\n\n@dave can you giv me and @Sali access to the above document so we can track the issues ther. ", "create_at": 1541068705000 } } 

I am reversing this for myself to try but I am interested in your feedback @ylluminarious

davidbartonau commented 6 years ago

@ylluminarious I have a local revision with that change reversed and it works really well.

jby commented 5 years ago

I'm seeing this as well with master (d887295), any tips on how to get around it?

Thinking it might be because the intended room already existed I tried to import into a different (non-existent) room, but where those messages went I have no earthly idea, the import went through without problem, but no channel/room was created and the messages seems to have gone into cyberspace...

jby commented 5 years ago

Cleaned everything out and went with an updated master of mattermost-docker (https://github.com/mattermost/mattermost-docker/commit/cb6690b5f8fe92a804b873e373829c51ceb3d8bd), but still I get all messages sent to the imported room ends up as private messages from me to me...

jby commented 5 years ago

It seems to be related to the room/channel type "P", if I try to import a room/channel of type "O" it does what I expect - creates a public room of the data...