fix im heartbeat and friend display name
This commit is contained in:
@@ -3411,6 +3411,14 @@ func relationshipContext(tenantAdp adapter.TenantBusinessAdapter, tenantID types
|
||||
if cachedFriend, err := cachedFriendContains(tenantID, userID, peerID); err != nil {
|
||||
logs.Warn.Printf("cache friend[%s:%s]: read failed: %v", userID.UserId(), peerID.UserId(), err)
|
||||
} else if cachedFriend {
|
||||
if friendship, err := tenantAdp.TenantFriendshipGet(tenantID, userID, peerID); err != nil {
|
||||
logs.Warn.Printf("friendship[%s:%s]: read failed after cache hit: %v", userID.UserId(), peerID.UserId(), err)
|
||||
} else if friendship != nil && friendship.Status == types.RelationshipFriend {
|
||||
ctx.Remark = friendship.Remark
|
||||
if friendship.Topic != "" {
|
||||
ctx.Topic = friendship.Topic
|
||||
}
|
||||
}
|
||||
ctx.Relationship = types.RelationshipFriend
|
||||
ctx.CanSend = true
|
||||
if ctx.Topic == "" {
|
||||
@@ -3424,6 +3432,7 @@ func relationshipContext(tenantAdp adapter.TenantBusinessAdapter, tenantID types
|
||||
cacheFriendOneWay(tenantID, userID, peerID)
|
||||
ctx.Relationship = types.RelationshipFriend
|
||||
ctx.CanSend = true
|
||||
ctx.Remark = friendship.Remark
|
||||
if ctx.Topic == "" {
|
||||
ctx.Topic = friendship.Topic
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user