Message Events

message:missed

This is triggered when missed messages are fetched from the server and there are new messages. Missed messages will be fetched in the following circumstances:

  • Calling the [messages.getMissed][vl-get-missed] function
  • When reconnecting after a disconnect

The event contains an array of objects containing id (the channel id) and messages. This grouping simplifies finding the relevant messages for the current channel. An example payload for this event:

[
  {
    "id": "2115543f-c236-4f81-a548-719b0929c465",
    "messages": [
      {
        "user": {
          "name": "Group User",
          "id": "9ded74f9-42e4-4e70-86aa-44ba4cd2c782",
          "email": "groupuser@example.com",
          "avatar_url": "https://gravatar.com/avatar/06aaff5772de7ecffbfae48831b2190d?s=200"
        },
        "updated_at": "2015-12-29T09:24:10.814329Z",
        "type": "text",
        "id": "e79d7808-0328-6c36-4412-4981ee285968",
        "duration": 0.0,
        "data": {
          "text": "This is a message"
        },
        "created_at": "2015-12-29T09:24:10.814331Z",
        "channel_id": "2115543f-c236-4f81-a548-719b0929c465"
      }
    ]
  },
  {
    "id": "aae0bc0c-8bf7-4c72-a413-b31965daf995",
    "messages": [
      {
        "user": {
          "name": "Group User",
          "id": "7be6e518-5e9e-4d5c-92ff-201a00af807a",
          "email": "groupuser@example.com",
          "avatar_url": "https://gravatar.com/avatar/06aaff5772de7ecffbfae48831b2190d?s=200"
        },
        "updated_at": "2015-12-29T09:24:10.814329Z",
        "type": "text",
        "id": "e79d7808-0328-6c36-4412-4981ee285968",
        "duration": 0.0,
        "data": {
          "text": "This is another message"
        },
        "created_at": "2015-12-29T09:24:10.814331Z",
        "channel_id": "aae0bc0c-8bf7-4c72-a413-b31965daf995"
      }
    ]
  }
]