Skip to content

Commit

Permalink
fix: 修复当群友是好友时可能出现找不到uid的情况
Browse files Browse the repository at this point in the history
  • Loading branch information
Redmomn committed Jul 17, 2024
1 parent ae4c1e4 commit 78def46
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ import (

// GetUid 获取缓存中对应uin的uid
func (c *QQClient) GetUid(uin uint32, groupUin ...uint32) string {
if c.cache.FriendCacheIsEmpty() {
if len(groupUin) == 0 && c.cache.FriendCacheIsEmpty() {
if err := c.RefreshFriendCache(); err != nil {
return ""
}
} else if c.cache.GroupMemberCacheIsEmpty(groupUin[0]) {
if err := c.RefreshGroupMembersCache(groupUin[0]); err != nil {
return ""
}
}
return c.cache.GetUid(uin, groupUin...)
}
Expand Down

0 comments on commit 78def46

Please sign in to comment.