format code
This commit is contained in:
@@ -91,9 +91,9 @@ func switchToTab(jid string, w *gtk.Window) {
|
|||||||
ok := u.Get(&hats)
|
ok := u.Get(&hats)
|
||||||
if ok {
|
if ok {
|
||||||
for _, hat := range hats.Hats {
|
for _, hat := range hats.Hats {
|
||||||
tag := gtk.NewImageFromPaintable(clientAssets["tag"])
|
tag := gtk.NewImageFromPaintable(clientAssets["tag"])
|
||||||
tag.SetTooltipText(hat.Title)
|
tag.SetTooltipText(hat.Title)
|
||||||
userbox.Prepend(tag)
|
userbox.Prepend(tag)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,9 +104,6 @@ func switchToTab(jid string, w *gtk.Window) {
|
|||||||
medal.SetHExpand(true)
|
medal.SetHExpand(true)
|
||||||
userbox.Append(medal)
|
userbox.Append(medal)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
gesture := gtk.NewGestureClick()
|
gesture := gtk.NewGestureClick()
|
||||||
gesture.SetButton(3) // Right click
|
gesture.SetButton(3) // Right click
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
||||||
"os"
|
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"os"
|
||||||
|
|
||||||
"github.com/diamondburned/gotk4/pkg/gio/v2"
|
"github.com/diamondburned/gotk4/pkg/gio/v2"
|
||||||
"github.com/diamondburned/gotk4/pkg/gtk/v4"
|
"github.com/diamondburned/gotk4/pkg/gtk/v4"
|
||||||
@@ -35,7 +34,7 @@ func dropToSignInPage(err error) {
|
|||||||
server_entry := gtk.NewEntry()
|
server_entry := gtk.NewEntry()
|
||||||
server_entry.SetHAlign(gtk.AlignEnd)
|
server_entry.SetHAlign(gtk.AlignEnd)
|
||||||
server_entry.SetHExpand(true)
|
server_entry.SetHExpand(true)
|
||||||
|
|
||||||
username_entry := gtk.NewEntry()
|
username_entry := gtk.NewEntry()
|
||||||
username_entry.SetHAlign(gtk.AlignEnd)
|
username_entry.SetHAlign(gtk.AlignEnd)
|
||||||
username_entry.SetHExpand(true)
|
username_entry.SetHExpand(true)
|
||||||
@@ -52,7 +51,6 @@ func dropToSignInPage(err error) {
|
|||||||
insecure_check.SetHAlign(gtk.AlignEnd)
|
insecure_check.SetHAlign(gtk.AlignEnd)
|
||||||
insecure_check.SetHExpand(true)
|
insecure_check.SetHExpand(true)
|
||||||
|
|
||||||
|
|
||||||
server_box.Append(server_label)
|
server_box.Append(server_label)
|
||||||
server_box.Append(server_entry)
|
server_box.Append(server_entry)
|
||||||
|
|
||||||
@@ -77,13 +75,13 @@ func dropToSignInPage(err error) {
|
|||||||
sumbit_btn := gtk.NewButtonWithLabel("Submit")
|
sumbit_btn := gtk.NewButtonWithLabel("Submit")
|
||||||
sumbit_btn.ConnectClicked(func() {
|
sumbit_btn.ConnectClicked(func() {
|
||||||
conf := new(lambdaConfig)
|
conf := new(lambdaConfig)
|
||||||
conf.Server = server_entry.Text()
|
conf.Server = server_entry.Text()
|
||||||
conf.Username = username_entry.Text()
|
conf.Username = username_entry.Text()
|
||||||
conf.Password = password_entry.Text()
|
conf.Password = password_entry.Text()
|
||||||
conf.Nick = nickname_entry.Text()
|
conf.Nick = nickname_entry.Text()
|
||||||
conf.Insecure = insecure_check.Active()
|
conf.Insecure = insecure_check.Active()
|
||||||
|
|
||||||
var b bytes.Buffer
|
var b bytes.Buffer
|
||||||
e := toml.NewEncoder(&b)
|
e := toml.NewEncoder(&b)
|
||||||
e.Encode(conf)
|
e.Encode(conf)
|
||||||
|
|
||||||
@@ -92,7 +90,6 @@ func dropToSignInPage(err error) {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
os.WriteFile(filepath.Join(p, "lambda.toml"), b.Bytes(), 0644)
|
os.WriteFile(filepath.Join(p, "lambda.toml"), b.Bytes(), 0644)
|
||||||
|
|
||||||
|
|
||||||
window.SetVisible(false)
|
window.SetVisible(false)
|
||||||
main()
|
main()
|
||||||
|
|||||||
18
xmpp-hats.go
18
xmpp-hats.go
@@ -9,21 +9,21 @@ import (
|
|||||||
// https://xmpp.org/extensions/xep-0317.html
|
// https://xmpp.org/extensions/xep-0317.html
|
||||||
|
|
||||||
type Hats struct {
|
type Hats struct {
|
||||||
XMLName xml.Name `xml:"urn:xmpp:hats:0 hats"`
|
XMLName xml.Name `xml:"urn:xmpp:hats:0 hats"`
|
||||||
Hats []Hat `xml:"hat"`
|
Hats []Hat `xml:"hat"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Hat struct {
|
type Hat struct {
|
||||||
Title string `xml:"title,attr"`
|
Title string `xml:"title,attr"`
|
||||||
URI string `xml:"uri,attr"`
|
URI string `xml:"uri,attr"`
|
||||||
Hue string `xml:"hue,attr"`
|
Hue string `xml:"hue,attr"`
|
||||||
Lang string `xml:"xml:lang,attr"`
|
Lang string `xml:"xml:lang,attr"`
|
||||||
Badge Badge `xml:"badge"`
|
Badge Badge `xml:"badge"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Badge struct {
|
type Badge struct {
|
||||||
XMLName xml.Name `xml:"urn:example:badges badge"`
|
XMLName xml.Name `xml:"urn:example:badges badge"`
|
||||||
Level int `xml:"level,attr"`
|
Level int `xml:"level,attr"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ func joinMuc(c xmpp.Sender, jid string, muc string, nick string) error {
|
|||||||
// jid MustParse but using gosrc's instead of mellium
|
// jid MustParse but using gosrc's instead of mellium
|
||||||
// This function will panic if its an invalid JID
|
// This function will panic if its an invalid JID
|
||||||
|
|
||||||
func JidMustParse(s string) (*stanza.Jid) {
|
func JidMustParse(s string) *stanza.Jid {
|
||||||
j, err := stanza.NewJid(s)
|
j, err := stanza.NewJid(s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ import (
|
|||||||
|
|
||||||
type XDCEl struct {
|
type XDCEl struct {
|
||||||
stanza.MsgExtension
|
stanza.MsgExtension
|
||||||
XMLName xml.Name `xml:"urn:xmpp:webxdc:0 x"`
|
XMLName xml.Name `xml:"urn:xmpp:webxdc:0 x"`
|
||||||
Document string `xml:"document"`
|
Document string `xml:"document"`
|
||||||
Summary string `xml:"summary"`
|
Summary string `xml:"summary"`
|
||||||
Payload string `xml:"urn:xmpp:json:0 json"` // TODO: Independent JSOn container type (XEP-0335)
|
Payload string `xml:"urn:xmpp:json:0 json"` // TODO: Independent JSOn container type (XEP-0335)
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|||||||
Reference in New Issue
Block a user