mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
Merge remote-tracking branch 'origin/tuoyun' into tuoyun
This commit is contained in:
commit
73da15586b
@ -76,6 +76,14 @@ func InsertFriendApplication(friendRequest *db.FriendRequest) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
friendRequest.CreateTime = time.Now()
|
||||
u := dbConn.Table("friend_requests").Where("from_user_id=? and to_user_id=?",
|
||||
friendRequest.FromUserID, friendRequest.ToUserID).Update(&friendRequest)
|
||||
if u.RowsAffected != 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
if friendRequest.CreateTime.Unix() < 0 {
|
||||
friendRequest.CreateTime = time.Now()
|
||||
}
|
||||
|
@ -36,6 +36,14 @@ func InsertIntoGroupRequest(toInsertInfo db.GroupRequest) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if toInsertInfo.HandledTime.Unix() < 0 {
|
||||
toInsertInfo.HandledTime = utils.UnixSecondToTime(0)
|
||||
}
|
||||
u := dbConn.Table("group_requests").Where("group_id=? and user_id=?", toInsertInfo.GroupID, toInsertInfo.UserID).Update(&toInsertInfo)
|
||||
if u.RowsAffected != 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
toInsertInfo.ReqTime = time.Now()
|
||||
if toInsertInfo.HandledTime.Unix() < 0 {
|
||||
toInsertInfo.HandledTime = utils.UnixSecondToTime(0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user