Class: ImageEvent

ImageEvent()

new ImageEvent()

An image event
Source:

Extends

Methods

del(imageRepresentationsopt) → {Promise}

Delete the image event, all 3 representations of it passing only the one of the three URLs
Parameters:
Name Type Attributes Default Description
imageRepresentations object <optional>
this.body.representations the ImageEvent.body for the image to delete
Overrides:
  • Event#del
Source:
Returns:
Type
Promise

delivered()

Set the message status to 'delivered'
Overrides:
  • Event#delivered
Source:

fetchImage(typeopt, representationsopt) → {string}

Download an Image from Media service //3 representations
Parameters:
Name Type Attributes Default Description
type string <optional>
"thumbnail" original, medium, thumbnail,
representations string <optional>
this.body.representations the ImageEvent.body for the image to download
Source:
Returns:
the dataUrl "data:image/jpeg;base64..."
Type
string
Example

Downloading an image from the imageEvent

                imageEvent.fetchImage().then((imagedata) => {
                     var img = new Image();
                     img.onload = function () {
                     };
                     img.src = imagedata;

                     // to cancel the request:
                     // conversation.abortSendImage(imageRequest);
                 });

seen()

Set the message status to 'seen'
Overrides:
  • Event#seen
Source: