MCPcopy Create free account
hub / github.com/LagrangeDev/LagrangeGo / GetCachedFriendInfo

Method GetCachedFriendInfo

client/cache.go:61–72  ·  view source on GitHub ↗

GetCachedFriendInfo 获取好友信息(缓存)

(uin uint32)

Source from the content-addressed store, hash-verified

59
60// GetCachedFriendInfo 获取好友信息(缓存)
61func (c *QQClient) GetCachedFriendInfo(uin uint32) *entity.User {
62 if c.cache.FriendCacheIsEmpty() {
63 if err := c.RefreshFriendCache(); err != nil {
64 return nil
65 }
66 }
67 if friend := c.cache.GetFriend(uin); friend != nil {
68 return friend
69 }
70 _ = c.RefreshFriendCache()
71 return c.cache.GetFriend(uin)
72}
73
74// GetCachedAllFriendsInfo 获取所有好友信息(缓存)
75func (c *QQClient) GetCachedAllFriendsInfo() map[uint32]*entity.User {

Callers 1

Calls 3

RefreshFriendCacheMethod · 0.95
FriendCacheIsEmptyMethod · 0.80
GetFriendMethod · 0.80

Tested by

no test coverage detected