From 18b5bc09356dd80024ecfd411145b3312b3fa7a1 Mon Sep 17 00:00:00 2001 From: bodqhrohro Date: Wed, 18 Dec 2019 23:00:23 +0200 Subject: Relogin fix --- persistence/sessions.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'persistence') diff --git a/persistence/sessions.go b/persistence/sessions.go index 66857f1..fd520d1 100644 --- a/persistence/sessions.go +++ b/persistence/sessions.go @@ -42,7 +42,16 @@ var sessionDB *SessionsYamlDB // SessionMarshaller implementation for YamlDB func SessionMarshaller() ([]byte, error) { - return yaml.Marshal(sessionDB.Data) + cleanedMap := SessionsMap{} + emptySessionsMap(&cleanedMap) + + for jid, session := range sessionDB.Data.Sessions { + if session.Login != "" { + cleanedMap.Sessions[jid] = session + } + } + + return yaml.Marshal(&cleanedMap) } // LoadSessions restores TDlib sessions from the previous run -- cgit v1.2.3