aboutsummaryrefslogtreecommitdiff
path: root/telegram/utils.go
diff options
context:
space:
mode:
authorbodqhrohro <bodqhrohro@gmail.com>2019-12-07 22:25:37 +0300
committerbodqhrohro <bodqhrohro@gmail.com>2019-12-07 22:25:37 +0300
commitb9c07b6f1666f9db12495ae7192585c407217eef (patch)
treebf13b7068ce9266f196cbad6b7fd094d631682ac /telegram/utils.go
parentea0d0df226aecf2e17bf3f137899e053155df1c4 (diff)
Treat contact lookups as successful if user is found but chat is not
Diffstat (limited to 'telegram/utils.go')
-rw-r--r--telegram/utils.go7
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