fix bug :pushMsg.MsgData.OfflinePushInfo==nil

pull/351/head
skiffer-git 2 years ago
parent ac2cc154b4
commit e990118475

@ -297,8 +297,11 @@ func GetOfflinePushOpts(pushMsg *pbPush.PushMsgReq) (opts push.PushOpts, err err
log.NewDebug(pushMsg.OperationID, opts)
}
}
opts.IOSBadgeCount = pushMsg.MsgData.OfflinePushInfo.IOSBadgeCount
opts.IOSPushSound = pushMsg.MsgData.OfflinePushInfo.IOSPushSound
if pushMsg.MsgData.OfflinePushInfo != nil {
opts.IOSBadgeCount = pushMsg.MsgData.OfflinePushInfo.IOSBadgeCount
opts.IOSPushSound = pushMsg.MsgData.OfflinePushInfo.IOSPushSound
}
return opts, nil
}

@ -142,6 +142,7 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupR
return &pbGroup.CreateGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, http.WrapError(constant.ErrDB)
}
}
if req.GroupInfo.GroupType != constant.SuperGroup {
//to group member
for _, user := range req.InitMemberList {

@ -34,6 +34,20 @@ func InsertIntoGroupMember(toInsertInfo db.GroupMember) error {
return nil
}
func BatchInsertIntoGroupMember(toInsertInfoList []*db.GroupMember) error {
//MessageList []*model_struct.LocalChatLog
//return utils.Wrap(d.conn.Create(MessageList).Error, "BatchInsertMessageList failed")
for _, toInsertInfo := range toInsertInfoList {
toInsertInfo.JoinTime = time.Now()
if toInsertInfo.RoleLevel == 0 {
toInsertInfo.RoleLevel = constant.GroupOrdinaryUsers
}
toInsertInfo.MuteEndTime = time.Unix(int64(time.Now().Second()), 0)
}
return db.DB.MysqlDB.DefaultGormDB().Create(toInsertInfoList).Error
}
func GetGroupMemberListByUserID(userID string) ([]db.GroupMember, error) {
var groupMemberList []db.GroupMember
err := db.DB.MysqlDB.DefaultGormDB().Table("group_members").Where("user_id=?", userID).Find(&groupMemberList).Error

Loading…
Cancel
Save