|
@ -90,6 +90,8 @@ class Sessions extends RedisModel {
|
|
|
for (let i in participantArray) {
|
|
|
participantIdArray.push(participantArray[i].split(":")[0]);
|
|
|
}
|
|
|
logger.error("create session by participantIdArray,:"+participantIdArray.join(","));
|
|
|
logger.error("create session by type,:"+type);
|
|
|
if (type == SESSION_TYPES.P2P || type == SESSION_TYPES.SYSTEM) {
|
|
|
if (sessionId) {
|
|
|
callBusinessType(sessionId);
|
|
@ -112,13 +114,9 @@ class Sessions extends RedisModel {
|
|
|
}
|
|
|
|
|
|
function callBusinessType(sessionId) {
|
|
|
if(type == SESSION_TYPES.MUC){
|
|
|
callCreate(sessionId, 2);
|
|
|
}else{
|
|
|
ParticipantRepo.getBusinessType(participantIdArray.join("','"), function (err, businessType) {
|
|
|
callCreate(sessionId, businessType);
|
|
|
});
|
|
|
}
|
|
|
ParticipantRepo.getBusinessType(participantIdArray, function (err, businessType) {
|
|
|
callCreate(sessionId, businessType);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function callCreate(sessionId, businessType) {
|
|
@ -132,6 +130,9 @@ class Sessions extends RedisModel {
|
|
|
timestamp: createDate,
|
|
|
id: messageId
|
|
|
};
|
|
|
if(type == SESSION_TYPES.MUC){
|
|
|
businessType = 2;
|
|
|
}
|
|
|
let session = {
|
|
|
id: sessionId,
|
|
|
name: name,
|
|
@ -185,7 +186,7 @@ class Sessions extends RedisModel {
|
|
|
|
|
|
//流程2-判断session的业务类型;
|
|
|
function callBusinessType() {
|
|
|
ParticipantRepo.getBusinessType(participantIdArray.join("','"), function (err, businessType) {
|
|
|
ParticipantRepo.getBusinessType(participantIdArray, function (err, businessType) {
|
|
|
if (err) {
|
|
|
handler(err, null);
|
|
|
return;
|
|
@ -236,7 +237,7 @@ class Sessions extends RedisModel {
|
|
|
handler(err, null);
|
|
|
return;
|
|
|
}
|
|
|
callBeginTrans(session);
|
|
|
// callBeginTrans(session);
|
|
|
})
|
|
|
}
|
|
|
|