@asteriskzuo/react-native-easemob
Version:
easemob chat sdk of react-native.
71 lines (52 loc) • 2.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ChatConversationType = exports.ChatConversation = void 0;
exports.ChatConversationTypeFromNumber = ChatConversationTypeFromNumber;
exports.ChatConversationTypeToString = ChatConversationTypeToString;
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
let ChatConversationType;
exports.ChatConversationType = ChatConversationType;
(function (ChatConversationType) {
ChatConversationType[ChatConversationType["PeerChat"] = 0] = "PeerChat";
ChatConversationType[ChatConversationType["GroupChat"] = 1] = "GroupChat";
ChatConversationType[ChatConversationType["RoomChat"] = 2] = "RoomChat";
})(ChatConversationType || (exports.ChatConversationType = ChatConversationType = {}));
function ChatConversationTypeFromNumber(params) {
switch (params) {
case 0:
return ChatConversationType.PeerChat;
case 1:
return ChatConversationType.GroupChat;
case 2:
return ChatConversationType.RoomChat;
default:
throw new Error(`not exist this type: ${params}`);
}
}
function ChatConversationTypeToString(params) {
return ChatConversationType[params];
}
class ChatConversation {
// todo: con_name
// todo:
//todo:
constructor(params) {
_defineProperty(this, "con_id", void 0);
_defineProperty(this, "type", void 0);
_defineProperty(this, "unreadCount", void 0);
_defineProperty(this, "con_name", void 0);
_defineProperty(this, "lastMessage", void 0);
_defineProperty(this, "lastReceivedMessage", void 0);
this.con_id = params.con_id;
this.type = params.type;
this.unreadCount = params.unreadCount; // this.lastMessage ;
// this.lastReceivedMessage;
if (params.ext) {
this.con_name = params.ext.con_name;
}
}
}
exports.ChatConversation = ChatConversation;
//# sourceMappingURL=ChatConversation.js.map