format code

This commit is contained in:
2026-05-19 14:07:21 +01:00
parent 5f95df147f
commit af0ec78eae
7 changed files with 12 additions and 12 deletions
+1
View File
@@ -204,4 +204,5 @@ func init() {
} { } {
loadAsset(key, data) loadAsset(key, data)
} }
} }
+5 -4
View File
@@ -42,11 +42,13 @@ func createTab(jid string, isMuc bool, name string) bool {
newTab := new(chatTab) newTab := new(chatTab)
newTab.isMuc = isMuc newTab.isMuc = isMuc
newTab.msgs = gtk.NewListBox() newTab.msgs = gtk.NewListBox()
newTab.msgs.SetVExpand(true) glib.IdleAdd(func() {
newTab.msgs.SetShowSeparators(true) newTab.msgs.SetVExpand(true)
newTab.msgs.SetShowSeparators(true)
newTab.msgs.Append(gtk.NewButtonWithLabel(loadedLocale["getPastMessages"]))
})
newTab.name = name newTab.name = name
newTab.msgs.Append(gtk.NewButtonWithLabel(loadedLocale["getPastMessages"]))
tabs.Store(jid, newTab) tabs.Store(jid, newTab)
return true return true
} }
@@ -215,7 +217,6 @@ func switchToTab(jid string, w *gtk.Window) {
medal.SetHExpand(true) medal.SetHExpand(true)
userbox.Append(medal) userbox.Append(medal)
default_av := createIdenticon(u.From, false) default_av := createIdenticon(u.From, false)
userbox.Prepend(default_av) userbox.Prepend(default_av)
var vcu VCardUpdate var vcu VCardUpdate
+2 -3
View File
@@ -12,12 +12,12 @@ import (
"github.com/google/uuid" "github.com/google/uuid"
"github.com/jasonlovesdoggo/gopen" "github.com/jasonlovesdoggo/gopen"
"gosrc.io/xmpp/stanza" "gosrc.io/xmpp/stanza"
xmpp_color "mellium.im/xmpp/color"
"mellium.im/xmpp/jid" "mellium.im/xmpp/jid"
"os" "os"
"path/filepath" "path/filepath"
"runtime" "runtime"
"strings" "strings"
xmpp_color "mellium.im/xmpp/color"
) )
func generatePresenceWidget(p stanza.Packet) gtk.Widgetter { func generatePresenceWidget(p stanza.Packet) gtk.Widgetter {
@@ -127,7 +127,7 @@ func generateMessageWidget(p stanza.Packet) gtk.Widgetter {
enter_custom.SetHExpand(true) enter_custom.SetHExpand(true)
enter_custom.ConnectClicked(func() { enter_custom.ConnectClicked(func() {
client.SendRaw(fmt.Sprintf(` client.SendRaw(fmt.Sprintf(`
<message from='%s' to='%s' id='%s' type='%s'> <message from='%s' to='%s' id='%s' type='%s'>
<reactions id='%s' xmlns='urn:xmpp:reactions:0'> <reactions id='%s' xmlns='urn:xmpp:reactions:0'>
<reaction>%s</reaction> <reaction>%s</reaction>
@@ -137,7 +137,6 @@ func generateMessageWidget(p stanza.Packet) gtk.Widgetter {
}) })
rc_box.Append(custom) rc_box.Append(custom)
rc_box.Append(enter_custom) rc_box.Append(enter_custom)
quote := gtk.NewButtonWithLabel("Quote") quote := gtk.NewButtonWithLabel("Quote")
quote.ConnectClicked(func() { quote.ConnectClicked(func() {
+1 -1
View File
@@ -405,7 +405,7 @@ func main() {
// The code is basically the exact same as above, we just don't check for mucuser // The code is basically the exact same as above, we just don't check for mucuser
// TODO: Presence handling code goes here // TODO: Presence handling code goes here
j := presence.From j := presence.From
tab, ok := tabs.Load(j) tab, ok := tabs.Load(j)
if ok { if ok {
typed_tab, ok := tab.(*chatTab) typed_tab, ok := tab.(*chatTab)
+2 -2
View File
@@ -2,9 +2,9 @@ package main
import ( import (
"github.com/diamondburned/gotk4/pkg/gtk/v4" "github.com/diamondburned/gotk4/pkg/gtk/v4"
"gosrc.io/xmpp/stanza"
"mellium.im/xmpp/color" "mellium.im/xmpp/color"
"sync" "sync"
"gosrc.io/xmpp/stanza"
) )
type chatTab struct { type chatTab struct {
@@ -27,7 +27,7 @@ type lambdaConfig struct {
Identicons bool Identicons bool
Debug bool Debug bool
ShowPresenceUpdates bool ShowPresenceUpdates bool
CompactMode bool CompactMode bool
CustomNicks map[string]string CustomNicks map[string]string
} }
+1 -1
View File
@@ -10,7 +10,7 @@ import (
type Ping struct { type Ping struct {
stanza.IQ stanza.IQ
XMLName xml.Name `xml:"urn:xmpp:ping ping"` XMLName xml.Name `xml:"urn:xmpp:ping ping"`
ResultSet *stanza.ResultSet `xml:"set,omitempty"` ResultSet *stanza.ResultSet `xml:"set,omitempty"`
} }
-1
View File
@@ -51,4 +51,3 @@ func init() {
stanza.TypeRegistry.MapExtension(stanza.PKTIQ, xml.Name{Space: "vcard-temp", Local: "vCard"}, VCard{}) stanza.TypeRegistry.MapExtension(stanza.PKTIQ, xml.Name{Space: "vcard-temp", Local: "vCard"}, VCard{})
stanza.TypeRegistry.MapExtension(stanza.PKTPresence, xml.Name{Space: "vcard-temp:x:update", Local: "x"}, VCardUpdate{}) stanza.TypeRegistry.MapExtension(stanza.PKTPresence, xml.Name{Space: "vcard-temp:x:update", Local: "x"}, VCardUpdate{})
} }