| 
					
				 | 
			
			
				@ -508,6 +508,7 @@ class Sessions extends RedisModel { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                let userRoles = res[5]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                let participantsTime = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                let isInvite = true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                let backTopid = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                //处理session未加入redis的bug 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -604,15 +605,19 @@ class Sessions extends RedisModel { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                    // cache topics for MUC 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                    let topicsKey = RedisModel.makeRedisKey(REDIS_KEYS.Topics, sessionId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                    log.info("gettopicid====") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                    TopicRepo.findAllBySessionId(sessionId, function (err, topics) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                        log.info("gettopicid====1") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                        if (err) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                            ModelUtil.emitError(self.eventEmitter, err.message); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                            return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                        topics.forEach(function (topic) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                            log.info("gettopicid====2") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                            let topicKey = RedisModel.makeRedisKey(REDIS_KEYS.Topic, topic.id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                            let topicId = topic.id; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                            backTopid = topicId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                            let name = topic.name == null ? "" : topic.name; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                            let createTime = ObjectUtil.timestampToLong(topic.create_time); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                            let endBy = topic.end_by == null ? "" : topic.end_by; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -632,6 +637,7 @@ class Sessions extends RedisModel { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                                    'start_message_id', startMessageId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                                    'end_message_id', endMessageId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                                    'description', description, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                                    'topic_id', topicId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                                    'status', status) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                                .execAsync() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                                .catch(function (ex) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -697,6 +703,20 @@ class Sessions extends RedisModel { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                            log.info("2.session.name:" + sessionName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                            log.info("2.session.business_type:" + session.business_type); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                            TopicRepo.findAllBySessionId(sessionId, function (err, topics) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                log.info("gettopicid====1") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                if (err) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                    ModelUtil.emitError(self.eventEmitter, err.message); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                    return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                topics.forEach(function (topic) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                    log.info("gettopicid====2") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                    let topicKey = RedisModel.makeRedisKey(REDIS_KEYS.Topic, topic.id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                    let topicId = topic.id; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                            }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                            sessionList.push({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                id: sessionId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                name: sessionName, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -714,7 +734,8 @@ class Sessions extends RedisModel { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                sender_birthday: bir, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                participantsTimeArray:participantsTime, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                status:session.status, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                is_invite:isInvite 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                is_invite:isInvite, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                backTopid:backTopid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                            }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                            index = (parseInt(index) + 1); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1654,10 +1675,11 @@ class Sessions extends RedisModel { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        function callPush(participants,message){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            participants.forEach(function (participant) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (participant.id !== message.sender_id && 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    participant.participant_role == PARTICIPANT_ROLES.HOST) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                // if ( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //     // participant.id !== message.sender_id && 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //     participant.participant_role == PARTICIPANT_ROLES.HOST) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    Sessions.pushNotification(participant.id, participant.name, message,sessionType); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                // } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 |