pull/255/head
skiffer-git 2 years ago
parent a01156feb6
commit 8ad22f8148

@ -106,6 +106,10 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupR
utils.CopyStructFields(&groupInfo, req.GroupInfo)
groupInfo.CreatorUserID = req.OpUserID
groupInfo.GroupID = groupId
if groupInfo.NotificationUpdateTime.Unix() < 0 {
groupInfo.NotificationUpdateTime = utils.UnixSecondToTime(0)
}
err := imdb.InsertIntoGroup(groupInfo)
if err != nil {
log.NewError(req.OperationID, "InsertIntoGroup failed, ", err.Error(), groupInfo)

@ -57,7 +57,8 @@ func setGroupInfo(groupID string, groupInfo *open_im_sdk.GroupInfo) error {
}
err = utils2.GroupDBCopyOpenIM(groupInfo, group)
if err != nil {
return utils.Wrap(err, "GetGroupMemberNumByGroupID failed")
log.NewWarn("", "GroupDBCopyOpenIM failed ", groupID, err.Error())
return nil
}
return nil
}

@ -32,9 +32,7 @@ func InsertIntoGroup(groupInfo db.Group) error {
groupInfo.GroupName = "Group Chat"
}
groupInfo.CreateTime = time.Now()
if groupInfo.NotificationUpdateTime.Unix() < 0 {
groupInfo.NotificationUpdateTime = utils.UnixSecondToTime(0)
}
err = dbConn.Table("groups").Create(groupInfo).Error
if err != nil {
return err

Loading…
Cancel
Save