diff options
Diffstat (limited to 'telegram/client.go')
-rw-r--r-- | telegram/client.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/telegram/client.go b/telegram/client.go index 4995597..8813df0 100644 --- a/telegram/client.go +++ b/telegram/client.go @@ -78,11 +78,16 @@ func NewClient(conf config.TelegramConfig, jid string, component *xmpp.Component return &Client{}, errors.Wrap(err, "Wrong api_id") } + datadir := conf.Tdlib.Datadir + if datadir == "" { + datadir = "./sessions/" // ye olde defaute + } + parameters := client.TdlibParameters{ UseTestDc: false, - DatabaseDirectory: filepath.Join("./sessions/", jid), - FilesDirectory: filepath.Join("./sessions/", jid, "/files/"), + DatabaseDirectory: filepath.Join(datadir, jid), + FilesDirectory: filepath.Join(datadir, jid, "/files/"), UseFileDatabase: true, UseChatInfoDatabase: conf.Tdlib.Client.UseChatInfoDatabase, |