diff options
author | bodqhrohro <bodqhrohro@gmail.com> | 2019-12-07 22:25:37 +0300 |
---|---|---|
committer | bodqhrohro <bodqhrohro@gmail.com> | 2019-12-07 22:25:37 +0300 |
commit | b9c07b6f1666f9db12495ae7192585c407217eef (patch) | |
tree | bf13b7068ce9266f196cbad6b7fd094d631682ac /telegram | |
parent | ea0d0df226aecf2e17bf3f137899e053155df1c4 (diff) |
Treat contact lookups as successful if user is found but chat is not
Diffstat (limited to 'telegram')
-rw-r--r-- | telegram/utils.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/telegram/utils.go b/telegram/utils.go index 8e2fdb9..ded9d2c 100644 --- a/telegram/utils.go +++ b/telegram/utils.go @@ -78,7 +78,12 @@ func (c *Client) GetContactByID(id int64, chat *client.Chat) (*client.Chat, *cli ChatId: id, }) if err != nil { - return nil, nil, err + // error is irrelevant if the user was found successfully + if user == nil { + return nil, nil, err + } else { + return nil, user, nil + } } c.cache.chats[id] = cacheChat |