From b3ce088a8eaf7e935334f1adaa0842777fcef6b9 Mon Sep 17 00:00:00 2001 From: James Mills Date: Sun, 3 Apr 2022 01:21:35 +0000 Subject: [PATCH] Remove inbox index state persistence (for now) (#134) Until https://git.mills.io/prologic/msgbus/issues/31 is implemented. Co-authored-by: James Mills Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/134 --- client.go | 4 ++-- cmd/salty-chat/chat.go | 7 ------- cmd/salty-chat/read.go | 6 ------ internal/web/app.wasm | 4 ++-- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/client.go b/client.go index 4cf657c..2dbcfb8 100644 --- a/client.go +++ b/client.go @@ -60,7 +60,7 @@ func parseExtraEnvs(extraenvs string) map[string]string { // PackMessage formts an outoing message in the Message Format // \t() func PackMessage(me *Addr, msg string) []byte { -log.Print("pack: ", me.Formatted(), msg) + log.Debugf("pack: ", me.Formatted(), msg) return []byte( fmt.Sprint( time.Now().UTC().Format(time.RFC3339), "\t", @@ -264,7 +264,7 @@ func (cli *Client) OutboxClient(to *Addr) *Client { capabilities: cli.me.capabilities, checkedAvatar: cli.me.checkedAvatar, }, - id: &Identity{ + id: &Identity{ addr: &Addr{ User: to.User, Domain: to.Domain, diff --git a/cmd/salty-chat/chat.go b/cmd/salty-chat/chat.go index 5714640..b41aeb8 100644 --- a/cmd/salty-chat/chat.go +++ b/cmd/salty-chat/chat.go @@ -5,7 +5,6 @@ import ( "os" "strings" - log "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/spf13/viper" @@ -51,18 +50,12 @@ func init() { func chat(me *saltyim.Addr, identity, state, user string) { cli, err := saltyim.NewClient(me, - saltyim.WithStateFromFile(state), saltyim.WithClientIdentity(saltyim.WithIdentityPath(identity)), ) if err != nil { fmt.Fprintf(os.Stderr, "error initializing client: %s\n", err) os.Exit(2) } - defer func() { - if err := cli.State().Save(state); err != nil { - log.WithError(err).Warnf("error saving state: %s", state) - } - }() // Set terminal title tui.SetTerminalTitle("Salty IM with %s", user) diff --git a/cmd/salty-chat/read.go b/cmd/salty-chat/read.go index b1069f6..18e308f 100644 --- a/cmd/salty-chat/read.go +++ b/cmd/salty-chat/read.go @@ -96,18 +96,12 @@ func init() { func read(me *saltyim.Addr, identity, state string, follow bool, extraenvs, prehook, posthook string, args ...string) { cli, err := saltyim.NewClient(me, - saltyim.WithStateFromFile(state), saltyim.WithClientIdentity(saltyim.WithIdentityPath(identity)), ) if err != nil { fmt.Fprintf(os.Stderr, "error initializing client: %s\n", err) os.Exit(2) } - defer func() { - if err := cli.State().Save(state); err != nil { - log.WithError(err).Warnf("error saving state: %s", state) - } - }() ctx, cancel := context.WithCancel(context.Background()) defer cancel() diff --git a/internal/web/app.wasm b/internal/web/app.wasm index 2237e03..8087d5d 100755 --- a/internal/web/app.wasm +++ b/internal/web/app.wasm @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3307a27d4095b3993f811f6c8ff81aec98f43c9e09968e7fc7a965a8df6ee303 -size 28582389 +oid sha256:8dc2d0f49b9c17ce443c79319aed9a435cc70ee2dadc40d731dfd8a31887bccc +size 28580151