Attempt to fix duplicated user tabs

This commit is contained in:
2026-02-03 10:38:41 +00:00
parent c260b8b231
commit 5c76729a6b
2 changed files with 9 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"github.com/diamondburned/gotk4/pkg/glib/v2"
"github.com/diamondburned/gotk4/pkg/gtk/v4"
"github.com/diamondburned/gotk4/pkg/pango"
"gosrc.io/xmpp/stanza"
)
@@ -19,7 +20,9 @@ func scrollToBottomAfterUpdate(scrolledWindow *gtk.ScrolledWindow) {
func createTab(jid string, isMuc bool) bool {
fmt.Println("Creating tab", jid, "isMuc:", isMuc)
_, ok := tabs.Load(jid)
if !ok {
_, uok := userdevices.Load(jid)
_, mok := mucmembers.Load(jid)
if !ok && !uok && !mok {
newTab := new(chatTab)
newTab.isMuc = isMuc
newTab.msgs = gtk.NewListBox()
@@ -60,6 +63,7 @@ func switchToTab(jid string, w *gtk.Window) {
u.Get(&ocu)
nick_label := gtk.NewLabel(JidMustParse(u.From).Resource)
nick_label.SetEllipsize(pango.EllipsizeEnd)
/*
affil_label := gtk.NewLabel("")
switch mu.MucUserItem.Affiliation {