|
|
@@ -494,7 +494,7 @@ func (g *Group) PushGroupMemberBanned(ctx context.Context, optId, userId int64, |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
if !isAllMemberBanned { |
|
|
|
if !isAllMemberBanned && userId > 0 { |
|
|
|
bannedUserResp, err := rpc.GetBusinessIntClient().GetUser(ctx, &pb.GetUserReq{UserId: userId}) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
@@ -510,14 +510,26 @@ func (g *Group) PushGroupMemberBanned(ctx context.Context, optId, userId int64, |
|
|
|
} |
|
|
|
return nil |
|
|
|
} else { |
|
|
|
err = g.PushMessage(ctx, pb.PushCode_PC_BANNED_GROUP_MEMBER, &pb.BannedGroupMemberPush{ |
|
|
|
OptId: optId, |
|
|
|
OptName: userResp.User.Nickname, |
|
|
|
BannedUserId: userId, |
|
|
|
BannedUserName: fmt.Sprintf("管理员\"%s\"设置了禁言", userResp.User.Nickname), |
|
|
|
}, true) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
if userId == 0 { |
|
|
|
err = g.PushMessage(ctx, pb.PushCode_PC_BANNED_GROUP_MEMBER, &pb.BannedGroupMemberPush{ |
|
|
|
OptId: optId, |
|
|
|
OptName: userResp.User.Nickname, |
|
|
|
BannedUserId: userId, |
|
|
|
BannedUserName: fmt.Sprintf("管理员\"%s\"设置群禁言", userResp.User.Nickname), |
|
|
|
}, true) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
} else { |
|
|
|
err = g.PushMessage(ctx, pb.PushCode_PC_BANNED_GROUP_MEMBER, &pb.BannedGroupMemberPush{ |
|
|
|
OptId: optId, |
|
|
|
OptName: userResp.User.Nickname, |
|
|
|
BannedUserId: userId, |
|
|
|
BannedUserName: fmt.Sprintf("管理员\"%s\"取消群禁言", userResp.User.Nickname), |
|
|
|
}, true) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
return nil |
|
|
|
} |
|
|
|