add Destroy room button, show error notification on presence error and show disabled lambda icon when not focused on any chat

This commit is contained in:
2026-02-15 13:08:52 +00:00
parent 29ef37e237
commit 09a809c102
9 changed files with 125 additions and 29 deletions

View File

@@ -50,6 +50,7 @@ func switchToTab(jid string, w *gtk.Window) {
scroller.SetChild(typed_tab.msgs)
if typed_tab.isMuc {
m, ok := mucmembers.Load(jid)
if !ok {
return
@@ -61,7 +62,9 @@ func switchToTab(jid string, w *gtk.Window) {
mm := ma.Members
gen := gtk.NewBox(gtk.OrientationVertical, 0)
i := 0
mm.Range(func(k, v any) bool {
i++
userbox := gtk.NewBox(gtk.OrientationHorizontal, 0)
u := v.(stanza.Presence)
@@ -76,36 +79,13 @@ func switchToTab(jid string, w *gtk.Window) {
nick_label := gtk.NewLabel(JidMustParse(u.From).Resource)
nick_label.SetEllipsize(pango.EllipsizeEnd)
/*
affil_label := gtk.NewLabel("")
switch mu.MucUserItem.Affiliation {
case "owner":
affil_label.SetText("O")
case "admin":
affil_label.SetText("A")
case "member":
affil_label.SetText("M")
case "none":
affil_label.SetText("-")
}
*/
nick_label.AddCSSClass(mu.MucUserItem.Role)
if mu.MucUserItem.Role == "visitor" {
nick_label.SetOpacity(0.5)
}
/*
affil_label.SetHAlign(gtk.AlignEnd)
affil_label.SetHExpand(true)
affil_label.AddCSSClass(mu.MucUserItem.Affiliation)
*/
userbox.SetTooltipText(fmt.Sprintf("%s\n%s\n%s\nRight-click for more information", u.From, mu.MucUserItem.Role, mu.MucUserItem.Affiliation))
userbox.Append(nick_label)
// userbox.Append(affil_label)
var hats Hats
ok := u.Get(&hats)
@@ -113,8 +93,6 @@ func switchToTab(jid string, w *gtk.Window) {
for _, hat := range hats.Hats {
tag := gtk.NewImageFromPaintable(clientAssets["tag"])
tag.SetTooltipText(hat.Title)
// tag.SetHAlign(gtk.AlignEnd)
// tag.SetHExpand(true)
userbox.Prepend(tag)
}
}
@@ -274,6 +252,11 @@ func switchToTab(jid string, w *gtk.Window) {
return true
})
headerBox := gtk.NewBox(gtk.OrientationHorizontal, 0)
headerBox.Append(gtk.NewImageFromPaintable(clientAssets["group"]))
headerBox.Append(gtk.NewLabel(fmt.Sprintf("%d participant(s)", i)))
gen.Prepend(headerBox)
memberList.SetChild(gen)
} else {
memberList.SetChild(gtk.NewLabel(jid))