package main import ( "go.wit.com/lib/protobuf/chatpb" "go.wit.com/log" "google.golang.org/protobuf/types/known/timestamppb" ) func doNewChat() { if found := me.chats.FindByUuid(argv.Uuid); found != nil { found.ChatName = argv.Topic me.chats.ConfigSave() return } chat := &chatpb.Chat{ Uuid: argv.Uuid, ChatName: argv.Topic, Ctime: timestamppb.Now(), } me.chats.Chats = append(me.chats.Chats, chat) me.chats.ConfigSave() log.Info("created new chat for", argv.Uuid) }