Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default class CCManager {
static cometchat = null;
static appId = 'ZZZ_CC_APPID' ; //Enter your App ID
static apiKey = 'ZZZ_CC_APIKEY' ; //Enter your API KEY
static appSetting = new CometChat.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion('eu').build();
static LISTENER_KEY_MESSAGE = "msglistener";
static LISTENER_KEY_USER = "userlistener";
static LISTENER_KEY_GROUP = "grouplistener";
static LISTENER_KEY_CALL = "calllistener";
static GroupType = {
'PUBLIC':CometChat.GROUP_TYPE.PUBLIC,
'PRIVATE':CometChat.GROUP_TYPE.PRIVATE,
'PASSWORD':CometChat.GROUP_TYPE.PASSWORD
};
static userRequest = null;
static groupRequest = null;
static init(dispatcher) {
CometChat.init(this.appId,this.appSetting);
}
static getInstance() {
if (CCManager.cometchat == null) {
CCManager.cometchat = CometChat.init(this.appId,this.appSetting);
}
return CCManager.cometchat;
}
static setUserRequestBuilder(limit){
import {CometChat} from "@cometchat-pro/chat";
import * as actionCreator from "./../../store/actions/cc_action";
export default class CCManager {
static cometchat = null;
static appId = 'ZZZ_CC_APPID' ; //Enter your App ID
static apiKey = 'ZZZ_CC_APIKEY' ; //Enter your API KEY
static appSetting = new CometChat.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion('eu').build();
static LISTENER_KEY_MESSAGE = "msglistener";
static LISTENER_KEY_USER = "userlistener";
static LISTENER_KEY_GROUP = "grouplistener";
static LISTENER_KEY_CALL = "calllistener";
static GroupType = {
'PUBLIC':CometChat.GROUP_TYPE.PUBLIC,
'PRIVATE':CometChat.GROUP_TYPE.PRIVATE,
'PASSWORD':CometChat.GROUP_TYPE.PASSWORD
};
static userRequest = null;
static groupRequest = null;
static init(dispatcher) {
CometChat.init(this.appId,this.appSetting);
}
static getInstance() {
if (CCManager.cometchat == null) {
CCManager.cometchat = CometChat.init(this.appId,this.appSetting);
}
return CCManager.cometchat;
}
export const joinPasswordGroup = (group, password) => {
return CometChat.joinGroup(
group.guid,
CometChat.GROUP_TYPE.PASSWORD,
password
);
};