|
@ -827,6 +827,7 @@ class Sessions extends RedisModel {
|
|
|
let message_timestamp_key = RedisModel.makeRedisKey(REDIS_KEYS.MessagesByTimestamp, sessionId);
|
|
|
if (!start_msg_id && !end_msg_id) {
|
|
|
redis.zrevrangeAsync(message_timestamp_key, 0, 0).then(function (res) {
|
|
|
log.info("session.js--830---getMessages res.length: " + res.length);
|
|
|
if (res.length == 0) {
|
|
|
//修复应redis没有缓冲聊天记录导致会话列表加载不出来
|
|
|
// cache messages
|
|
@ -994,7 +995,7 @@ class Sessions extends RedisModel {
|
|
|
}
|
|
|
|
|
|
participants.existsParticipant(sessionId, userId, function (err, res) {
|
|
|
if (!res) {
|
|
|
if (! res[0].exist || userId != "system") {
|
|
|
handler(Error("User not found in session " + sessionId), null);
|
|
|
} else {
|
|
|
//将消息ID转换成分值
|
|
@ -1281,8 +1282,8 @@ class Sessions extends RedisModel {
|
|
|
ModelUtil.emitError(self.eventEmitter, "Check session participant failed: ", err);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (res) {
|
|
|
logger.info("session.js--1285--res[0].exist" + res[0].exist);
|
|
|
if ( res[0].exist || userId == "system") {
|
|
|
redis.hmgetAsync(sessionKey, ["type", "name"]).then(function (res) {
|
|
|
sessionType = res[0];
|
|
|
let sessionName = res[1];
|
|
@ -1394,7 +1395,7 @@ class Sessions extends RedisModel {
|
|
|
}
|
|
|
// 发送成员必须处于会话中
|
|
|
participants.existsParticipant(sessionId, message.sender_id, function (err, res) {
|
|
|
if (res) {
|
|
|
if ( res[0].exist || userId == "system") {
|
|
|
redis.hmgetAsync(session_key, ["type", "name"]).then(function (res) {
|
|
|
sessionType = res[0];
|
|
|
sessionName = res[1];
|
|
@ -1473,7 +1474,8 @@ class Sessions extends RedisModel {
|
|
|
}
|
|
|
// 发送成员必须处于会话中
|
|
|
participants.existsParticipant(sessionId, message.sender_id, function (err, res) {
|
|
|
if (res.exist) {
|
|
|
log.info("session.js--1477--res[0].exist" + res[0].exist);
|
|
|
if (res[0].exist || userId == "system") {
|
|
|
redis.hmgetAsync(session_key, ["type", "name"]).then(function (res) {
|
|
|
sessionType = res[0];
|
|
|
sessionName = res[1];
|