fix im heartbeat and friend display name

This commit is contained in:
richjohnrambo
2026-09-10 15:23:27 +08:00
parent 14ee3d937f
commit 1f3a98605e
8 changed files with 248 additions and 29 deletions
+9
View File
@@ -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
}