6
1
mirror of https://git.mills.io/saltyim/saltyim.git synced 2024-06-20 13:58:22 +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:
James Mills 2022-04-03 01:21:35 +00:00
parent 908e4cf525
commit b3ce088a8e
4 changed files with 4 additions and 17 deletions

@ -60,7 +60,7 @@ func parseExtraEnvs(extraenvs string) map[string]string {
// PackMessage formts an outoing message in the Message Format
// <timestamp>\t(<sender>) <message>
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,

@ -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)

@ -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()

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3307a27d4095b3993f811f6c8ff81aec98f43c9e09968e7fc7a965a8df6ee303
size 28582389
oid sha256:8dc2d0f49b9c17ce443c79319aed9a435cc70ee2dadc40d731dfd8a31887bccc
size 28580151