@asteriskzuo/react-native-easemob
Version:
easemob chat sdk of react-native.
190 lines (149 loc) • 7.66 kB
JavaScript
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; }
/**
* The settings of the chat SDK.
*
* You can set parameters and options of the SDK.
*
* For example, whether to encrypt the messages before sending, whether to automatically accept the friend invitations.
*/
export class ChatOptions {
/**
* The app key you got from the console when create an app.
*/
/**
* Enables/Disables automatic login.
*
* `true`: (default) Enables automatic login;
* `false`: Disables automatic login.
*/
/**
* Debug mode or not.
*/
/**
* Whether to accept friend invitations from other users automatically.
*
* `true`: (default) Accepts friend invitations automatically;
* `false`: Do not accept friend invitations automatically.
*/
/**
* Whether to accept group invitations automatically.
*
* `true`: (default) Accepts group invitations automatically;
* `false`: Do not accept group invitations automatically.
*/
/**
* Whether the read receipt is required.
*
* `true`: (default) The read receipt is required;
* `false`: The read receipt is not required.
*/
/**
* Whether the delivery receipt is required.
*
* `true`: (default) The read receipt is required;
* `false`: The read receipt is not required.
*/
/**
* Whether to delete the group message when leaving a group.
*
* `true`: (default) Delete the messages when leaving the group.
* `false`: Do not delete the messages when leaving a group.
*/
/**
* Whether to delete the chat room message when leaving the chat room.
*
* `true`: (default) Delete the chat room related message record when leaving the chat room.
* `false`: Do not delete the chat room related message record when leaving the chat room.
*/
/**
* Whether to allow the chat room owner to leave the chat room.
*
* `true`: (default) Allow the chat room owner to leave the chat room.
* `false`: Do not allow the chat room owner to leave the chat room.
*/
/**
* Whether to sort messages by the server received time.
*
* `true`: (default) Sort messages by the server received time;
* `false`: Do not sort messages by the server received time.
*/
/**
* Sets whether only HTTPS is used for REST operations.
*
* `true`: (default) Only HTTPS is used.
* `false`: Allow to use both HTTP and HTTPS.
*/
/**
* Whether to upload the message attachments automatically to the chat server.
*
* `true`: (default) Use the default way to upload and download the message attachments by chat server;
* `false`: Do not use the default way to upload and download the message attachments by chat server, using a customized path instead.
*/
/**
* Whether to auto download the thumbnail.
*
* `true`: (default) Download the thumbnail automatically;
* `false`: Do not download the thumbnail automatically.
*/
// pushConfig?: //todo: not implement
/**
* Sets whether to disable DNS.
*
* `true`: (default) Enable DNS;
* `false`: Do not enable DNS.
*/
/**
* The DNS url.
*/
/**
* The custom REST server.
*/
/**
* The custom im message server url.
*/
/**
* The custom im server port.
*/
constructor(params) {
var _params$autoLogin, _params$debugModel, _params$acceptInvitat, _params$autoAcceptGro, _params$requireAck, _params$requireDelive, _params$deleteMessage, _params$deleteMessage2, _params$isChatRoomOwn, _params$sortMessageBy, _params$usingHttpsOnl, _params$serverTransfe, _params$isAutoDownloa, _params$enableDNSConf, _params$dnsUrl, _params$restServer, _params$imServer, _params$imPort;
_defineProperty(this, "appKey", void 0);
_defineProperty(this, "autoLogin", void 0);
_defineProperty(this, "debugModel", void 0);
_defineProperty(this, "acceptInvitationAlways", void 0);
_defineProperty(this, "autoAcceptGroupInvitation", void 0);
_defineProperty(this, "requireAck", void 0);
_defineProperty(this, "requireDeliveryAck", void 0);
_defineProperty(this, "deleteMessagesAsExitGroup", void 0);
_defineProperty(this, "deleteMessagesAsExitChatRoom", void 0);
_defineProperty(this, "isChatRoomOwnerLeaveAllowed", void 0);
_defineProperty(this, "sortMessageByServerTime", void 0);
_defineProperty(this, "usingHttpsOnly", void 0);
_defineProperty(this, "serverTransfer", void 0);
_defineProperty(this, "isAutoDownload", void 0);
_defineProperty(this, "enableDNSConfig", void 0);
_defineProperty(this, "dnsUrl", void 0);
_defineProperty(this, "restServer", void 0);
_defineProperty(this, "imServer", void 0);
_defineProperty(this, "imPort", void 0);
this.appKey = params.appKey;
this.autoLogin = (_params$autoLogin = params.autoLogin) !== null && _params$autoLogin !== void 0 ? _params$autoLogin : true;
this.debugModel = (_params$debugModel = params.debugModel) !== null && _params$debugModel !== void 0 ? _params$debugModel : false;
this.acceptInvitationAlways = (_params$acceptInvitat = params.acceptInvitationAlways) !== null && _params$acceptInvitat !== void 0 ? _params$acceptInvitat : false;
this.autoAcceptGroupInvitation = (_params$autoAcceptGro = params.autoAcceptGroupInvitation) !== null && _params$autoAcceptGro !== void 0 ? _params$autoAcceptGro : false;
this.requireAck = (_params$requireAck = params.requireAck) !== null && _params$requireAck !== void 0 ? _params$requireAck : true;
this.requireDeliveryAck = (_params$requireDelive = params.requireDeliveryAck) !== null && _params$requireDelive !== void 0 ? _params$requireDelive : false;
this.deleteMessagesAsExitGroup = (_params$deleteMessage = params.deleteMessagesAsExitGroup) !== null && _params$deleteMessage !== void 0 ? _params$deleteMessage : true;
this.deleteMessagesAsExitChatRoom = (_params$deleteMessage2 = params.deleteMessagesAsExitChatRoom) !== null && _params$deleteMessage2 !== void 0 ? _params$deleteMessage2 : true;
this.isChatRoomOwnerLeaveAllowed = (_params$isChatRoomOwn = params.isChatRoomOwnerLeaveAllowed) !== null && _params$isChatRoomOwn !== void 0 ? _params$isChatRoomOwn : true;
this.sortMessageByServerTime = (_params$sortMessageBy = params.sortMessageByServerTime) !== null && _params$sortMessageBy !== void 0 ? _params$sortMessageBy : true;
this.usingHttpsOnly = (_params$usingHttpsOnl = params.usingHttpsOnly) !== null && _params$usingHttpsOnl !== void 0 ? _params$usingHttpsOnl : false;
this.serverTransfer = (_params$serverTransfe = params.serverTransfer) !== null && _params$serverTransfe !== void 0 ? _params$serverTransfe : true;
this.isAutoDownload = (_params$isAutoDownloa = params.isAutoDownload) !== null && _params$isAutoDownloa !== void 0 ? _params$isAutoDownloa : true; //todo: not implement
this.enableDNSConfig = (_params$enableDNSConf = params.enableDNSConfig) !== null && _params$enableDNSConf !== void 0 ? _params$enableDNSConf : true;
this.dnsUrl = (_params$dnsUrl = params.dnsUrl) !== null && _params$dnsUrl !== void 0 ? _params$dnsUrl : '';
this.restServer = (_params$restServer = params.restServer) !== null && _params$restServer !== void 0 ? _params$restServer : '';
this.imServer = (_params$imServer = params.imServer) !== null && _params$imServer !== void 0 ? _params$imServer : '';
this.imPort = (_params$imPort = params.imPort) !== null && _params$imPort !== void 0 ? _params$imPort : 0;
}
}
//# sourceMappingURL=ChatOptions.js.map