diff --git a/gtk-helpers.go b/gtk-helpers.go index 28256a5..898259b 100644 --- a/gtk-helpers.go +++ b/gtk-helpers.go @@ -11,6 +11,7 @@ import ( "github.com/diamondburned/gotk4/pkg/glib/v2" "github.com/diamondburned/gotk4/pkg/gtk/v4" "github.com/diamondburned/gotk4/pkg/pango" + "github.com/google/uuid" "github.com/rrivera/identicon" "gosrc.io/xmpp/stanza" "image" @@ -53,6 +54,18 @@ func showUserWindow(u stanza.Presence, custom_nick string) { profile_box.Append(status_message) } + if u.Show != "" { + show := string(u.Show) + show_label := gtk.NewLabel(show) + friendlyShow, ok := loadedLocale[show] + if ok { + show_label.SetText(friendlyShow) + show_label.AddCSSClass(show) + } + + profile_box.Append(show_label) + } + if loadedConfig.BlockingOI[ocu.ID] { blocked_note := gtk.NewLabel("You have blocked this user!") blocked_note.AddCSSClass("blocked") @@ -69,7 +82,7 @@ func showUserWindow(u stanza.Presence, custom_nick string) { Type: "get", From: clientroot.Session.BindJid, To: u.From, - Id: "vc2", + Id: uuid.New().String(), Lang: "en", }) @@ -122,7 +135,7 @@ func showUserWindow(u stanza.Presence, custom_nick string) { Type: "get", From: clientroot.Session.BindJid, To: u.From, - Id: "dicks", + Id: uuid.New().String(), Lang: "en", }) @@ -302,6 +315,10 @@ func switchToTab(jid string, w *gtk.Window) { failed_icon := gtk.NewImageFromPaintable(clientAssetsLoad("fail")) failed_icon.SetPixelSize(100) box.Append(failed_icon) + jid_label := gtk.NewLabel(jid) + jid_label.AddCSSClass("author") + jid_label.AddCSSClass("jid") + box.Append(jid_label) label := gtk.NewLabel("There was an error loading the members of this room. Maybe the MUC does not give user presence, it does not exist, you have been banned from it, or you have to fill a CAPTCHA to access it. Try joining the room again or check if the room exists.") label.SetWrap(true) box.Append(label) @@ -314,6 +331,10 @@ func switchToTab(jid string, w *gtk.Window) { failed_icon := gtk.NewImageFromPaintable(clientAssetsLoad("fail")) failed_icon.SetPixelSize(100) box.Append(failed_icon) + jid_label := gtk.NewLabel(jid) + jid_label.AddCSSClass("author") + jid_label.AddCSSClass("jid") + box.Append(jid_label) label := gtk.NewLabel("There was an error loading the members of this room. Maybe the MUC does not give user presence, it does not exist, you have been banned from it, or you have to fill a CAPTCHA to access it. Try joining the room again or check if the room exists.") label.SetWrap(true) box.Append(label) diff --git a/l18n.go b/l18n.go index 9c343da..63d82f7 100644 --- a/l18n.go +++ b/l18n.go @@ -94,10 +94,15 @@ var enGB = map[string]string{ // British English "versionQueryEmpty": "Client responded with empty version", "versionQueryError": "Got error trying to get version", + "away": "Away", + "chat": "Free for chat", + "xa": "Extended Away", + "dnd": "Do not disturb", + // gtk-signin.go "SIServerLabel": "Server: ", - "SIUsernameLabel": "Username: ", + "SIUsernameLabel": "JID: ", "SIPasswordLabel": "Password: ", "SINicknameLabel": "Nickname: ", "SIInsecureLabel": "Insecure: (?)", diff --git a/style.css b/style.css index d2c5425..b8ae471 100644 --- a/style.css +++ b/style.css @@ -90,3 +90,25 @@ background-color: orange; color: black; } + +.away { + color: orange; + font-style: italic; +} + +.xa { + opacity: 50%; + font-style: italic; + text-decoration: underline; +} + +.dnd { + font-style: bold; + color: red; +} + +.chat { + font-style: bold; + text-decoration: underline; + color: green; +}