Skip to content

Commit

Permalink
fix: cache logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Redmomn committed Apr 20, 2024
1 parent bb4e67f commit 725e7fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func (c *QQClient) GetUid(uin uint32, groupUin ...uint32) string {

// GetUin 获取缓存中对应的uin
func (c *QQClient) GetUin(uid string, groupUin ...uint32) uint32 {
if c.cache.FriendCacheIsEmpty() {
if len(groupUin) == 0 && c.cache.FriendCacheIsEmpty() {
c.RefreshFriendCache()
}
if len(groupUin) != 0 && c.cache.GroupMemberCacheIsEmpty(groupUin[0]) {
Expand All @@ -34,7 +34,7 @@ func (c *QQClient) GetCachedFriendInfo(uin uint32) *entity.Friend {
// GetCachedGroupInfo 获取群信息(缓存)
func (c *QQClient) GetCachedGroupInfo(groupUin uint32) *entity.Group {
if c.cache.GroupInfoCacheIsEmpty() {
c.RefreshGroupMembersCache(groupUin)
c.RefreshAllGroupsInfo()
}
return c.cache.GetGroupInfo(groupUin)
}
Expand Down

0 comments on commit 725e7fc

Please sign in to comment.