UNPKG

rcs-data

Version:

RCS消息数据结构

56 lines 2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RcsMsgInitial = void 0; const constants_1 = require("./constants"); const RcsMsgMono_1 = require("./RcsMsgMono"); class RcsMsgInitial extends RcsMsgMono_1.RcsMsgMono { constructor(mime) { super(mime); this._deliveryInfoList = []; this._processingStatus = constants_1.Processing_Status.stored; } set conversationId(value) { this._conversationId = value; } get conversationId() { return this._conversationId; } set contributionId(value) { this._contributionId = value; } get contributionId() { return this._contributionId; } get initialContentType() { return this.contentType; } get processingNotification() { return this._processingStatus; } set processingNotification(status) { this._processingStatus = status; } get deliveryNotification() { let status = this.deliveryInfoList .filter((di) => di.content.status === constants_1.Delivery_Status.delivered || di.content.status === constants_1.Delivery_Status.failed) .map((di) => di.content.status); if (status.length) { if (status.includes(constants_1.Delivery_Status.delivered)) return constants_1.Delivery_Status.delivered; else if (status.includes(constants_1.Delivery_Status.failed)) return constants_1.Delivery_Status.failed; } return constants_1.Delivery_Status.unknown; } get displayNotification() { if (this.deliveryInfoList.find((di) => di.content.status === constants_1.Display_Status.displayed)) return constants_1.Display_Status.displayed; return constants_1.Display_Status.unknown; } get deliveryInfoList() { return this._deliveryInfoList; } } exports.RcsMsgInitial = RcsMsgInitial; //# sourceMappingURL=RcsMsgInitial.js.map