diff --git a/server/imserver_new/friend/friendmgr.go b/server/imserver_new/friend/friendmgr.go index 36e67e95..a425b1b5 100644 --- a/server/imserver_new/friend/friendmgr.go +++ b/server/imserver_new/friend/friendmgr.go @@ -273,17 +273,7 @@ func (this *friendMgr) AsyncDeleteFriend(senderId string, targetId string, cb fu return } accountId1, accountId2 := this.sortAccounts(senderId, targetId) - f5.GetJsStyleDb().Update( - constant.FRIEND_DB, - "t_friend_relationship", - [][]string{ - {"deleted", q5.ToString(1)}, - {"del_time", q5.ToString(f5.GetApp().GetNowSeconds())}, - }, - [][]string{ - {"account_id1", accountId1}, - {"account_id2", accountId2}, - }, + model.Friend.DeleteSoft(accountId1, accountId2, func (err error, lastInsertId int64, rowsAffected int64) { if err != nil { cb(1, "") diff --git a/server/imserver_new/model/friend.go b/server/imserver_new/model/friend.go index 3ff818be..6af2c069 100644 --- a/server/imserver_new/model/friend.go +++ b/server/imserver_new/model/friend.go @@ -35,3 +35,19 @@ func (this *friend) Force(accountId1 string, accountId2 string, nowTime int64, }, cb) } + +func (this *friend) DeleteSoft(accountId1 string, accountId2 string, + cb func (error, int64, int64)) { + f5.GetJsStyleDb().Update( + constant.FRIEND_DB, + "t_friend_relationship", + [][]string{ + {"deleted", q5.ToString(1)}, + {"del_time", q5.ToString(f5.GetApp().GetNowSeconds())}, + }, + [][]string{ + {"account_id1", accountId1}, + {"account_id2", accountId2}, + }, + cb) +}