Fix bug: first time add friend (#844)

* new feature: add batch send msg

* new feature: add batch send msg

* new feature: add batch send msg

* new feature: add batch send msg

* new feature: add batch send msg

* new feature: add batch send msg

* fix bug: multiple gateway kick user

* fix bug: multiple gateway kick user

* fix bug: multiple gateway kick user

* fix bug: multiple gateway kick user

* fix bug: multiple gateway kick user

* MsgDestructTime

* fix bug: msg destruct sql

* fix bug: msg destruct

* fix bug: msg destruct

* fix bug: msg destruct sql

* fix bug: msg destruct sql

* fix bug: msg destruct sql

* fix bug: msg destruct sql

* debug: print stack

* debug: print stack

* debug: print stack

* fix bug: msg destruct sql

Signed-off-by: wangchuxiao <wangchuxiao97@outlook.com>

* fix bug: msg notification self 2 self push twice

* fix bug: heartbeat get self notification

* fix bug: init grpc conn in one process

* fix bug: grpc conn

Signed-off-by: wangchuxiao <wangchuxiao97@outlook.com>

* fix bug: zk client recreate node when reconn

* fix bug: set friend mark args error

* fix bug: rpc client intercepter called twice

Signed-off-by: wangchuxiao <wangchuxiao97@outlook.com>

* cicd: robot automated Change

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* test: document msg num set 100

* new feat: sync designated model

* new feat: sync designated model

* new feat: sync designated model

* new feat: sync designated model

* new feat: sync designated model

* new feat: sync designated model

* new feat: sync designated model

* merge code

* merge code

* fix bug: repeat add friend not effect

* fix bug: refused friend

* fix bug: fix_add_friend

* fix bug: fix_add_friend

* fix bug: fix_add_friend

---------

Signed-off-by: wangchuxiao <wangchuxiao97@outlook.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: wangchuxiao-dev <wangchuxiao-dev@users.noreply.github.com>
pull/849/head
WangchuXiao 1 year ago committed by GitHub
parent bde3d98d0f
commit 415d40f8c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -209,6 +209,7 @@ func (f *friendDatabase) RefuseFriendRequest(
if fr.HandleResult != 0 {
return errs.ErrArgs.Wrap("the friend request has been processed")
}
log.ZDebug(ctx, "refuse friend request", "friendRequest db", fr, "friendRequest arg", friendRequest)
friendRequest.HandleResult = constant.FriendResponseRefuse
friendRequest.HandleTime = time.Now()
err = f.friendRequest.Update(ctx, friendRequest)

@ -71,9 +71,13 @@ func (f *FriendRequestGorm) UpdateByMap(
// 更新记录 (非零值).
func (f *FriendRequestGorm) Update(ctx context.Context, friendRequest *relation.FriendRequestModel) (err error) {
fromUserID := friendRequest.FromUserID
toUserID := friendRequest.ToUserID
friendRequest.FromUserID = ""
friendRequest.ToUserID = ""
return utils.Wrap(
f.db(ctx).
Where("from_user_id = ? AND to_user_id =?", friendRequest.FromUserID, friendRequest.ToUserID).
Where("from_user_id = ? AND to_user_id =?", fromUserID, toUserID).
Updates(friendRequest).
Error,
"",

@ -33,5 +33,6 @@ func NewMetaDB(db *gorm.DB, table any) *MetaDB {
}
func (g *MetaDB) db(ctx context.Context) *gorm.DB {
return g.DB.WithContext(ctx).Model(g.table)
db := g.DB.WithContext(ctx).Model(g.table)
return db
}

Loading…
Cancel
Save