fix bug: add friend need update both request

pull/534/head
wangchuxiao 1 year ago
parent 4c365701d4
commit 643de8c7ec

@ -291,8 +291,9 @@ const (
GroupResponseAgree = 1
GroupResponseRefuse = -1
FriendResponseAgree = 1
FriendResponseRefuse = -1
FriendResponseNotHandle = 0
FriendResponseAgree = 1
FriendResponseRefuse = -1
Male = 1
Female = 2

@ -238,7 +238,7 @@ func (f *friendDatabase) AgreeFriendRequest(
}
fr2, err := f.friendRequest.NewTx(tx).Take(ctx, friendRequest.ToUserID, friendRequest.FromUserID)
if err == nil {
if err == nil && fr2.HandleResult == constant.FriendResponseNotHandle {
fr2.HandlerUserID = mcontext.GetOpUserID(ctx)
fr2.HandleResult = constant.FriendResponseAgree
fr2.HandleTime = now

Loading…
Cancel
Save