From b9c07b6f1666f9db12495ae7192585c407217eef Mon Sep 17 00:00:00 2001 From: bodqhrohro Date: Sat, 7 Dec 2019 21:25:37 +0200 Subject: [PATCH] Treat contact lookups as successful if user is found but chat is not --- telegram/utils.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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