|
|
|
@ -58,7 +58,7 @@ func (c *Client) GetContactByID(id int64, chat *client.Chat) (*client.Chat, *cli
|
|
|
|
|
|
|
|
|
|
if id <= math.MaxInt32 && id >= math.MinInt32 {
|
|
|
|
|
userID := int32(id)
|
|
|
|
|
user, ok = cache.users[userID]
|
|
|
|
|
user, ok = c.cache.users[userID]
|
|
|
|
|
if !ok && userID > 0 {
|
|
|
|
|
user, err = c.client.GetUser(&client.GetUserRequest{
|
|
|
|
|
UserId: userID,
|
|
|
|
@ -67,11 +67,11 @@ func (c *Client) GetContactByID(id int64, chat *client.Chat) (*client.Chat, *cli
|
|
|
|
|
return nil, nil, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cache.users[userID] = user
|
|
|
|
|
c.cache.users[userID] = user
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cacheChat, ok = cache.chats[id]
|
|
|
|
|
cacheChat, ok = c.cache.chats[id]
|
|
|
|
|
if !ok {
|
|
|
|
|
if chat == nil {
|
|
|
|
|
cacheChat, err = c.client.GetChat(&client.GetChatRequest{
|
|
|
|
@ -81,9 +81,9 @@ func (c *Client) GetContactByID(id int64, chat *client.Chat) (*client.Chat, *cli
|
|
|
|
|
return nil, nil, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cache.chats[id] = cacheChat
|
|
|
|
|
c.cache.chats[id] = cacheChat
|
|
|
|
|
} else {
|
|
|
|
|
cache.chats[id] = chat
|
|
|
|
|
c.cache.chats[id] = chat
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if chat == nil {
|
|
|
|
|