UNPKG

agora-react-native-rtm

Version:

React Native around the Agora RTM SDKs for Android and iOS agora

32 lines (31 loc) 1.65 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RtmHistoryInternal = void 0; var _RTMHistory = require("../api/RTMHistory"); var _AgoraRtmBase = require("../legacy/AgoraRtmBase"); var _IAgoraRtmHistoryImpl = require("../legacy/impl/IAgoraRtmHistoryImpl"); var _IrisRtmEngine = require("./IrisRtmEngine"); class RtmHistoryInternal extends _RTMHistory.RTMHistory { _rtmHistoryImpl = new _IAgoraRtmHistoryImpl.IRtmHistoryImpl(); async getMessages(channelName, channelType, options) { let operation = 'getMessages'; let callBack = 'onGetHistoryMessagesResult'; try { var _result$callBackResul, _result$callBackResul2, _result$callBackResul3; const status = this._rtmHistoryImpl.getMessages(channelName, channelType, options ?? new _AgoraRtmBase.GetHistoryMessagesOptions()); let result = await (0, _IrisRtmEngine.wrapRtmResult)(status, operation, callBack, true); return { timestamp: result.timestamp, messageList: (_result$callBackResul = result.callBackResult) === null || _result$callBackResul === void 0 ? void 0 : _result$callBackResul.messageList, count: (_result$callBackResul2 = result.callBackResult) === null || _result$callBackResul2 === void 0 ? void 0 : _result$callBackResul2.count, newStart: (_result$callBackResul3 = result.callBackResult) === null || _result$callBackResul3 === void 0 ? void 0 : _result$callBackResul3.newStart }; } catch (error) { throw (0, _IrisRtmEngine.handleError)(error, operation); } } } exports.RtmHistoryInternal = RtmHistoryInternal; //# sourceMappingURL=RtmHistoryInternal.js.map