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
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@ type RelationshipContext struct {
|
||||
Topic string `json:"topic"`
|
||||
Relationship string `json:"relationship"`
|
||||
CanSend bool `json:"can_send"`
|
||||
Remark string `json:"remark,omitempty"`
|
||||
RequestID string `json:"request_id,omitempty"`
|
||||
PendingStatus string `json:"pending_status,omitempty"`
|
||||
Peer *User `json:"peer,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user