diff options
Diffstat (limited to 'persistence')
-rw-r--r-- | persistence/sessions.go | 11 |
1 files changed, 10 insertions, 1 deletions
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 |