mirror of
https://git.mills.io/saltyim/saltyim.git
synced 2024-06-29 18:21:06 +00:00
Remove inbox index state persistence (for now) (#134)
Until https://git.mills.io/prologic/msgbus/issues/31 is implemented. Co-authored-by: James Mills <prologic@shortcircuit.net.au> Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/134
This commit is contained in:
parent
908e4cf525
commit
b3ce088a8e
@ -60,7 +60,7 @@ func parseExtraEnvs(extraenvs string) map[string]string {
|
|||||||
// PackMessage formts an outoing message in the Message Format
|
// PackMessage formts an outoing message in the Message Format
|
||||||
// <timestamp>\t(<sender>) <message>
|
// <timestamp>\t(<sender>) <message>
|
||||||
func PackMessage(me *Addr, msg string) []byte {
|
func PackMessage(me *Addr, msg string) []byte {
|
||||||
log.Print("pack: ", me.Formatted(), msg)
|
log.Debugf("pack: ", me.Formatted(), msg)
|
||||||
return []byte(
|
return []byte(
|
||||||
fmt.Sprint(
|
fmt.Sprint(
|
||||||
time.Now().UTC().Format(time.RFC3339), "\t",
|
time.Now().UTC().Format(time.RFC3339), "\t",
|
||||||
|
@ -5,7 +5,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
|
||||||
@ -51,18 +50,12 @@ func init() {
|
|||||||
|
|
||||||
func chat(me *saltyim.Addr, identity, state, user string) {
|
func chat(me *saltyim.Addr, identity, state, user string) {
|
||||||
cli, err := saltyim.NewClient(me,
|
cli, err := saltyim.NewClient(me,
|
||||||
saltyim.WithStateFromFile(state),
|
|
||||||
saltyim.WithClientIdentity(saltyim.WithIdentityPath(identity)),
|
saltyim.WithClientIdentity(saltyim.WithIdentityPath(identity)),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "error initializing client: %s\n", err)
|
fmt.Fprintf(os.Stderr, "error initializing client: %s\n", err)
|
||||||
os.Exit(2)
|
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
|
// Set terminal title
|
||||||
tui.SetTerminalTitle("Salty IM with %s", user)
|
tui.SetTerminalTitle("Salty IM with %s", user)
|
||||||
|
@ -96,18 +96,12 @@ func init() {
|
|||||||
|
|
||||||
func read(me *saltyim.Addr, identity, state string, follow bool, extraenvs, prehook, posthook string, args ...string) {
|
func read(me *saltyim.Addr, identity, state string, follow bool, extraenvs, prehook, posthook string, args ...string) {
|
||||||
cli, err := saltyim.NewClient(me,
|
cli, err := saltyim.NewClient(me,
|
||||||
saltyim.WithStateFromFile(state),
|
|
||||||
saltyim.WithClientIdentity(saltyim.WithIdentityPath(identity)),
|
saltyim.WithClientIdentity(saltyim.WithIdentityPath(identity)),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "error initializing client: %s\n", err)
|
fmt.Fprintf(os.Stderr, "error initializing client: %s\n", err)
|
||||||
os.Exit(2)
|
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())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:3307a27d4095b3993f811f6c8ff81aec98f43c9e09968e7fc7a965a8df6ee303
|
oid sha256:8dc2d0f49b9c17ce443c79319aed9a435cc70ee2dadc40d731dfd8a31887bccc
|
||||||
size 28582389
|
size 28580151
|
||||||
|
Loading…
Reference in New Issue
Block a user