diff --git a/cache.go b/cache.go index 7a837f1..e22b026 100644 --- a/cache.go +++ b/cache.go @@ -5,6 +5,7 @@ package main import ( "crypto/sha256" + "errors" "fmt" "github.com/diamondburned/gotk4/pkg/gdk/v4" "github.com/diamondburned/gotk4/pkg/gtk/v4" @@ -14,7 +15,6 @@ import ( "os" "path/filepath" "sync" - "errors" ) // global or app-level map/cache diff --git a/gtk-helpers.go b/gtk-helpers.go index ec22f9a..c61dd12 100644 --- a/gtk-helpers.go +++ b/gtk-helpers.go @@ -196,7 +196,7 @@ func switchToTab(jid string, w *gtk.Window) { } } - status := gtk.NewImageFromPaintable(clientAssetsLoad("status_"+string(u.Show))) + status := gtk.NewImageFromPaintable(clientAssetsLoad("status_" + string(u.Show))) status.SetTooltipText(string(u.Show)) status.SetHAlign(gtk.AlignEnd) @@ -217,21 +217,23 @@ func switchToTab(jid string, w *gtk.Window) { medal.SetHExpand(true) userbox.Append(medal) - default_av := createIdenticon(u.From, false) - userbox.Prepend(default_av) - var vcu VCardUpdate - ok = u.Get(&vcu) - if ok { - photo := vcu.Photo - go func() { - new_im := getAvatar(u.From, photo) + if loadedConfig.ShowAvatarsInMemberList { + default_av := createIdenticon(u.From, false) + userbox.Prepend(default_av) + var vcu VCardUpdate + ok = u.Get(&vcu) + if ok { + photo := vcu.Photo + go func() { + new_im := getAvatar(u.From, photo) - glib.IdleAdd(func() { - userbox.Remove(default_av) - userbox.Prepend(new_im) - }) - }() + glib.IdleAdd(func() { + userbox.Remove(default_av) + userbox.Prepend(new_im) + }) + }() + } } gesture := gtk.NewGestureClick() diff --git a/gtk-signin.go b/gtk-signin.go index ec4ecef..726b243 100644 --- a/gtk-signin.go +++ b/gtk-signin.go @@ -93,6 +93,7 @@ func dropToSignInPage(err error) { conf.Insecure = insecure_check.Active() conf.JoinBookmarks = true conf.Resource = randomClientResource() + conf.ShowAvatarsInMemberList = true var b bytes.Buffer e := toml.NewEncoder(&b) diff --git a/main.go b/main.go index 74833d9..2d49dc3 100644 --- a/main.go +++ b/main.go @@ -76,7 +76,6 @@ var userdevices sync.Map var pingTimes = [][]float64{} - var xmlLog *os.File func init() { diff --git a/types.go b/types.go index cfaf96b..aa62de2 100644 --- a/types.go +++ b/types.go @@ -16,19 +16,20 @@ type chatTab struct { } type lambdaConfig struct { - Server string - Username string - Resource string - Password string - Insecure bool - Nick string - JoinBookmarks bool - CVD color.CVD - Identicons bool - Debug bool - ShowPresenceUpdates bool - CompactMode bool - CustomNicks map[string]string + Server string + Username string + Resource string + Password string + Insecure bool + Nick string + JoinBookmarks bool + CVD color.CVD + Identicons bool + Debug bool + ShowPresenceUpdates bool + CompactMode bool + ShowAvatarsInMemberList bool + CustomNicks map[string]string } type mucUnit struct {