Source: events/text_event.js

'use strict';
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
/*
 * Nexmo Client SDK
 *  Text NXMEvent Object Model
 *
 * Copyright (c) Nexmo Inc.
*/
const nxmEvent_1 = __importDefault(require("./nxmEvent"));
/**
 * A text event
 *
 * @class TextEvent
 * @extends NXMEvent
*/
class TextEvent extends nxmEvent_1.default {
    constructor(conversation, params) {
        super(conversation, params);
        this.type = 'text';
        this.conversation = conversation;
        this.state = {
            seen_by: {},
            delivered_to: {}
        };
        if (params && params.body && params.body.timestamp) {
            this.timestamp = params.body.timestamp;
        }
        Object.assign(this, params);
    }
    /**
     * Set the message status to 'seen'
     * @returns {Promise}
     */
    seen() {
        return super.seen();
    }
    /**
     * Set the message status to 'delivered'.
     * handled by the SDK
     * @returns {Promise}
     */
    delivered() {
        return super.delivered();
    }
    /**
     * Delete the event
     * @returns {Promise}
     */
    del() {
        return super.del();
    }
}
exports.default = TextEvent;
module.exports = TextEvent;