Attempt to fix duplicated user tabs
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user