summaryrefslogtreecommitdiff
path: root/session.go
diff options
context:
space:
mode:
Diffstat (limited to 'session.go')
-rw-r--r--session.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/session.go b/session.go
index a6c0e8b..23d725d 100644
--- a/session.go
+++ b/session.go
@@ -90,6 +90,12 @@ func loadOldChatOrGetNew() []models.MessagesStory {
chatMap[newChat.Name] = newChat
return defaultStarter
}
+ if chat.Name == "" {
+ logger.Warn("empty chat name", "id", chat.ID)
+ chat.Name = fmt.Sprintf("%d_%v", chat.ID, chat.CreatedAt.Unix())
+ }
+ chatMap[chat.Name] = chat
+ activeChatName = chat.Name
return history
}