|
|
@@ -4,6 +4,7 @@ import ( |
|
|
|
"context" |
|
|
|
"gim/internal/business/comm/db" |
|
|
|
svc "gim/internal/business/comm/service" |
|
|
|
repo2 "gim/internal/business/domain/user/repo" |
|
|
|
"gim/internal/logic/domain/message/md" |
|
|
|
"gim/internal/logic/domain/message/model" |
|
|
|
"gim/internal/logic/domain/message/repo" |
|
|
@@ -158,10 +159,19 @@ func (*messageService) SendToUser(ctx context.Context, sender *pb.Sender, toUser |
|
|
|
} |
|
|
|
|
|
|
|
isOpenAppPush := svc.SysCfgGet(masterId, "is_open_app_push") |
|
|
|
if req.ReceiverType == 1 && isOpenAppPush == "1" { |
|
|
|
if sender.SenderType == 1 && req.ReceiverType == 1 && isOpenAppPush == "1" { |
|
|
|
uid := strconv.FormatInt(req.ReceiverId, 10) |
|
|
|
alia := db.DbUserPushForJg.UserPushForJgGetWithDb(masterId, uid) |
|
|
|
if alia != "" { |
|
|
|
if sender.Nickname == "" { |
|
|
|
sendUser, err := repo2.UserRepo.Get(sender.SenderId) |
|
|
|
if err != nil { |
|
|
|
logger.Sugar.Error(err) |
|
|
|
return 0, err |
|
|
|
} |
|
|
|
sender.Nickname = sendUser.Nickname |
|
|
|
sender.AvatarUrl = sendUser.AvatarUrl |
|
|
|
} |
|
|
|
//TODO::接收者类型为`user`, 进行极光推送 |
|
|
|
CommAddPush(md.PushParams{ |
|
|
|
MasterId: masterId, |
|
|
|