| 
															
																@ -353,7 +353,7 @@ class Sessions extends RedisModel { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                            .zscore(sessionParticipantsKey, userId)    // 用户在此会话中最后一次获取未读消息的时间 
															 | 
															
															 | 
															
																                            .zscore(sessionParticipantsKey, userId)    // 用户在此会话中最后一次获取未读消息的时间 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                            .zrange(sessionParticipantsKey, 0, -1) 
															 | 
															
															 | 
															
																                            .zrange(sessionParticipantsKey, 0, -1) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                            .zrange(sessionParticipantsKey, 0,-1,'withscores')  // 所有用户在此会话中最后一次获取未读消息的时间 
															 | 
															
															 | 
															
																                            .zrange(sessionParticipantsKey, 0,-1,'withscores')  // 所有用户在此会话中最后一次获取未读消息的时间 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                            .hgetall(participantsRoleKey)  // 所有用户在此会话中最后一次获取未读消息的时间 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                            .hgetall(participantsRoleKey)  // 所有用户在此会话中角色 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                            .execAsync() 
															 | 
															
															 | 
															
																                            .execAsync() 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                            .then(function (res) { 
															 | 
															
															 | 
															
																                            .then(function (res) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                let session = res[0]; 
															 | 
															
															 | 
															
																                                let session = res[0]; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -494,6 +494,7 @@ class Sessions extends RedisModel { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                            .zscore(sessionParticipantsKey, userId)    // 用户在此会话中最后一次获取未读消息的时间 
															 | 
															
															 | 
															
																                            .zscore(sessionParticipantsKey, userId)    // 用户在此会话中最后一次获取未读消息的时间 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                            .zrange(sessionParticipantsKey, 0, -1) 
															 | 
															
															 | 
															
																                            .zrange(sessionParticipantsKey, 0, -1) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                            .zrange(sessionParticipantsKey, 0,-1,'withscores')  // 所有用户在此会话中最后一次获取未读消息的时间 
															 | 
															
															 | 
															
																                            .zrange(sessionParticipantsKey, 0,-1,'withscores')  // 所有用户在此会话中最后一次获取未读消息的时间 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                            .hgetall(participantsRoleKey)  // 所有用户在此会话中角色 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                            .execAsync() 
															 | 
															
															 | 
															
																                            .execAsync() 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                            .then(function (res) { 
															 | 
															
															 | 
															
																                            .then(function (res) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                let session = res[0]; 
															 | 
															
															 | 
															
																                                let session = res[0]; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -501,7 +502,15 @@ class Sessions extends RedisModel { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                let lastFetchTime = res[2]; 
															 | 
															
															 | 
															
																                                let lastFetchTime = res[2]; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                let users = res[3]; 
															 | 
															
															 | 
															
																                                let users = res[3]; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                let participantsTimeArray = res[4]; 
															 | 
															
															 | 
															
																                                let participantsTimeArray = res[4]; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                let userRoles = res[5]; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                let participantsTime = []; 
															 | 
															
															 | 
															
																                                let participantsTime = []; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                let isInvite = true; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                for(var j in userRoles){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                    if(userRoles[j]==1){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                        isInvite = false; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                        break; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                for(var j = 0 ;j<participantsTimeArray.length;j++){ 
															 | 
															
															 | 
															
																                                for(var j = 0 ;j<participantsTimeArray.length;j++){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                    if(j%2!=0)continue; 
															 | 
															
															 | 
															
																                                    if(j%2!=0)continue; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                    let participantsTimeJson = {}; 
															 | 
															
															 | 
															
																                                    let participantsTimeJson = {}; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -556,7 +565,8 @@ class Sessions extends RedisModel { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                                sender_sex: sex, 
															 | 
															
															 | 
															
																                                                sender_sex: sex, 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                                sender_birthday: bir, 
															 | 
															
															 | 
															
																                                                sender_birthday: bir, 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                                participantsTimeArray:participantsTime, 
															 | 
															
															 | 
															
																                                                participantsTimeArray:participantsTime, 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                                status:session.status 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                                status:session.status, 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                                is_invite:isInvite 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                            }); 
															 | 
															
															 | 
															
																                                            }); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                            index = (parseInt(index) + 1); 
															 | 
															
															 | 
															
																                                            index = (parseInt(index) + 1); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -1029,7 +1039,7 @@ class Sessions extends RedisModel { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                                            message.content_type == CONTENT_TYPES.Audio|| 
															 | 
															
															 | 
															
																                                                            message.content_type == CONTENT_TYPES.Audio|| 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                                            message.content_type == CONTENT_TYPES.Video)){ 
															 | 
															
															 | 
															
																                                                            message.content_type == CONTENT_TYPES.Video)){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                            TopicRepo.findLastBySessionId(sessionId,function(err,res){ 
															 | 
															
															 | 
															
																                            TopicRepo.findLastBySessionId(sessionId,function(err,res){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                if(res&&res.length>0){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                if(res&&res.length>0&&res[0].reply==0){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                    TopicRepo.updateTopics(res[0].id,{reply:1},function(err,res){ 
															 | 
															
															 | 
															
																                                    TopicRepo.updateTopics(res[0].id,{reply:1},function(err,res){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                        if(err){ 
															 | 
															
															 | 
															
																                                        if(err){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                            logger.error("update topic reply error"); 
															 | 
															
															 | 
															
																                                            logger.error("update topic reply error"); 
															 |