diff options
author | bodqhrohro <bodqhrohro@gmail.com> | 2019-12-19 00:00:23 +0300 |
---|---|---|
committer | bodqhrohro <bodqhrohro@gmail.com> | 2019-12-19 00:00:23 +0300 |
commit | 18b5bc09356dd80024ecfd411145b3312b3fa7a1 (patch) | |
tree | 3f9c8be21d21eee61be6a00d62bbc77dd514fbd3 /persistence/sessions.go | |
parent | 05a9aca537a9420244860374da6b56731f483637 (diff) |
Relogin fix
Diffstat (limited to 'persistence/sessions.go')
-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 |