diff options
author | bodqhrohro <bodqhrohro@gmail.com> | 2019-11-12 18:50:25 +0300 |
---|---|---|
committer | bodqhrohro <bodqhrohro@gmail.com> | 2019-11-12 18:50:25 +0300 |
commit | a5c97d68e77ca8c9c5518051f085051487cd0fbf (patch) | |
tree | 75e94674574fc613090bd2f05c88ec9d7f8d751d /telegram/client.go | |
parent | fbe99c65ec36bb0d8b3a508e0894a9830ff9c995 (diff) |
Spawn TDlib instances for recovered sessions
Diffstat (limited to 'telegram/client.go')
-rw-r--r-- | telegram/client.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/telegram/client.go b/telegram/client.go index 688912b..82f65d0 100644 --- a/telegram/client.go +++ b/telegram/client.go @@ -7,6 +7,7 @@ import ( "strconv" "dev.narayana.im/narayana/telegabber/config" + "dev.narayana.im/narayana/telegabber/persistence" "github.com/zelenin/go-tdlib/client" ) @@ -35,12 +36,13 @@ type Client struct { client *client.Client jid string parameters *client.TdlibParameters + session *persistence.Session online bool logVerbosity client.Option } // NewClient instantiates a Telegram App -func NewClient(conf config.TelegramConfig, jid string) (Client, error) { +func NewClient(conf config.TelegramConfig, jid string, session *persistence.Session) (Client, error) { logVerbosity := client.WithLogVerbosity(&client.SetLogVerbosityLevelRequest{ NewVerbosityLevel: stringToLogConstant(conf.Loglevel), }) @@ -76,6 +78,7 @@ func NewClient(conf config.TelegramConfig, jid string) (Client, error) { return Client{ parameters: ¶meters, jid: jid, + session: session, logVerbosity: logVerbosity, }, nil } |