Explorar o código

消息发送整改

%!s(int64=8) %!d(string=hai) anos
pai
achega
244fb25d08

+ 2 - 1
src/server/models/sessions/participants.js

@ -152,11 +152,12 @@ class Participants extends RedisModel {
        let self = this;
        let participants_key = RedisModel.makeRedisKey(REDIS_KEYS.SessionParticipants, sessionId);
        let user_session_key = RedisModel.makeRedisKey(REDIS_KEYS.UserSessions, userId);
        let participants_role_key = RedisModel.makeRedisKey(REDIS_KEYS.SessionParticipantsRole, sessionId);
        // 移除会话中的成员信息,用户的Session信息及MySQL中的记录
        redis.multi()
            .zrem(participants_key, userId)
            .zrem(user_session_key, sessionId)
            .hdel(participants_role_key,userId)
            .execAsync()
            .then(function (res) {
                self.deleteUserFromMysql(sessionId, userId);

+ 2 - 2
src/server/repository/mysql/participant.repo.js

@ -218,11 +218,11 @@ class ParticipantRepo {
    }
    static deleteUserFromMysql(sessionId, userId,handler) {
        let sql = "delete from " + DB_TABLES.Participants + " where user_id=? and session_id=? ";
        let sql = "delete from " + DB_TABLES.Participants + " where participant_id=? and session_id=? ";
        ImDb.execQuery({
            "sql": sql,
            "args": [userId, sessionId],
            "handler": handler||function(){
            "handler": handler||function(err,res){
                log.info("deleteUserFromMysql");
            }
        });