you need a man, with, sen-si-ti-vi-ty. a man like me
This commit is contained in:
+3
-1
@@ -261,7 +261,7 @@ func createTab(jid string, isMuc bool, name string) bool {
|
|||||||
glib.IdleAdd(func() {
|
glib.IdleAdd(func() {
|
||||||
newTab.msgs.SetVExpand(true)
|
newTab.msgs.SetVExpand(true)
|
||||||
newTab.msgs.SetShowSeparators(true)
|
newTab.msgs.SetShowSeparators(true)
|
||||||
newTab.msgs.Append(gtk.NewButtonWithLabel(loadedLocale["getPastMessages"]))
|
// newTab.msgs.Append(gtk.NewButtonWithLabel(loadedLocale["getPastMessages"]))
|
||||||
})
|
})
|
||||||
newTab.name = name
|
newTab.name = name
|
||||||
|
|
||||||
@@ -692,7 +692,9 @@ func showErrorDialog(err error, w *gtk.Window) {
|
|||||||
func createIdenticon(word string, always_create bool, i *gtk.Image) { // This function generates an identicon
|
func createIdenticon(word string, always_create bool, i *gtk.Image) { // This function generates an identicon
|
||||||
if !loadedConfig.Identicons && !always_create {
|
if !loadedConfig.Identicons && !always_create {
|
||||||
// return gtk.NewImageFromPaintable(clientAssetsLoad("DefaultAvatar"))
|
// return gtk.NewImageFromPaintable(clientAssetsLoad("DefaultAvatar"))
|
||||||
|
glib.IdleAdd(func() {
|
||||||
i.SetFromPaintable(clientAssetsLoad("DefaultAvatar"))
|
i.SetFromPaintable(clientAssetsLoad("DefaultAvatar"))
|
||||||
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+18
-12
@@ -7,7 +7,7 @@ import (
|
|||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/diamondburned/gotk4/pkg/gdk/v4"
|
"github.com/diamondburned/gotk4/pkg/gdk/v4"
|
||||||
_ "github.com/diamondburned/gotk4/pkg/glib/v2"
|
"github.com/diamondburned/gotk4/pkg/glib/v2"
|
||||||
"github.com/diamondburned/gotk4/pkg/gtk/v4"
|
"github.com/diamondburned/gotk4/pkg/gtk/v4"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/jasonlovesdoggo/gopen"
|
"github.com/jasonlovesdoggo/gopen"
|
||||||
@@ -290,25 +290,27 @@ func generateMessageWidget(p stanza.Packet, blocked bool) (gtk.Widgetter, bool)
|
|||||||
if !ok {
|
if !ok {
|
||||||
can_generate = false
|
can_generate = false
|
||||||
}
|
}
|
||||||
|
|
||||||
im := gtk.NewImage()
|
im := gtk.NewImage()
|
||||||
|
im.SetFromPaintable(clientAssetsLoad("DefaultAvatar"))
|
||||||
|
im.SetPixelSize(40)
|
||||||
|
im.AddCSSClass("author_img")
|
||||||
|
// createIdenticon(m.From, false, im)
|
||||||
|
authorBox.Append(im)
|
||||||
if can_generate {
|
if can_generate {
|
||||||
pres := mmmm.(stanza.Presence)
|
pres := mmmm.(stanza.Presence)
|
||||||
var vu VCardUpdate
|
var vu VCardUpdate
|
||||||
pres.Get(&vu)
|
pres.Get(&vu)
|
||||||
createIdenticon(m.From, false, im)
|
|
||||||
im.SetPixelSize(40)
|
|
||||||
im.AddCSSClass("author_img")
|
|
||||||
authorBox.Append(im)
|
|
||||||
|
|
||||||
if vu.Photo != "" {
|
if vu.Photo != "" {
|
||||||
go getAvatar(m.From, vu.Photo, im)
|
go getAvatar(m.From, vu.Photo, im)
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
createIdenticon(m.From, false, im)
|
createIdenticon(m.From, false, im)
|
||||||
|
/*
|
||||||
im.SetPixelSize(40)
|
im.SetPixelSize(40)
|
||||||
im.AddCSSClass("author_img")
|
im.AddCSSClass("author_img")
|
||||||
authorBox.Append(im)
|
authorBox.Append(im)
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
} else if m.Type == stanza.MessageTypeChat {
|
} else if m.Type == stanza.MessageTypeChat {
|
||||||
al.SetText(al.Text() + loadedLocale["whispers"])
|
al.SetText(al.Text() + loadedLocale["whispers"])
|
||||||
@@ -329,7 +331,10 @@ func generateMessageWidget(p stanza.Packet, blocked bool) (gtk.Widgetter, bool)
|
|||||||
authorBox.Append(gtk.NewLabel("🎮"))
|
authorBox.Append(gtk.NewLabel("🎮"))
|
||||||
}
|
}
|
||||||
|
|
||||||
mlabel := gtk.NewLabel(m.Body)
|
body := m.Body
|
||||||
|
body = XEPToPango(body)
|
||||||
|
|
||||||
|
mlabel := gtk.NewLabel("")
|
||||||
if m.Body == "" {
|
if m.Body == "" {
|
||||||
/*
|
/*
|
||||||
mlabel.SetText(loadedLocale["noBodySet"])
|
mlabel.SetText(loadedLocale["noBodySet"])
|
||||||
@@ -337,6 +342,8 @@ func generateMessageWidget(p stanza.Packet, blocked bool) (gtk.Widgetter, bool)
|
|||||||
*/
|
*/
|
||||||
return nil, false
|
return nil, false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mlabel.SetMarkup(body)
|
||||||
mlabel.SetWrap(true)
|
mlabel.SetWrap(true)
|
||||||
mlabel.SetSelectable(true)
|
mlabel.SetSelectable(true)
|
||||||
mlabel.SetHAlign(gtk.AlignFill)
|
mlabel.SetHAlign(gtk.AlignFill)
|
||||||
@@ -401,6 +408,7 @@ func generateMessageWidget(p stanza.Packet, blocked bool) (gtk.Widgetter, bool)
|
|||||||
|
|
||||||
mainBox.Append(lp_box)
|
mainBox.Append(lp_box)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if loadedConfig.BlockingMode == Highlight && blocked {
|
if loadedConfig.BlockingMode == Highlight && blocked {
|
||||||
@@ -510,15 +518,13 @@ func getAvatar(j, hash string, i *gtk.Image) { // TODO: This function probably s
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glib.IdleAdd(func() {
|
||||||
err = setImageFromPath(hash, i)
|
err = setImageFromPath(hash, i)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
|
||||||
invalidImages.Store(oghash, true)
|
invalidImages.Store(oghash, true)
|
||||||
createIdenticon(j, false, i)
|
createIdenticon(j, false, i)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("Everything is OK. There should be an avatar!")
|
|
||||||
|
|
||||||
i.AddCSSClass(loadedConfig.CVD.String() + "_CVD")
|
i.AddCSSClass(loadedConfig.CVD.String() + "_CVD")
|
||||||
// return i
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -317,6 +317,7 @@ func main() {
|
|||||||
if valid && converted_successfully {
|
if valid && converted_successfully {
|
||||||
typed_tab.msgs.Append(b)
|
typed_tab.msgs.Append(b)
|
||||||
b.Append(ba)
|
b.Append(ba)
|
||||||
|
b.Append(gtk.NewSeparator(gtk.OrientationVertical))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -404,6 +405,7 @@ func main() {
|
|||||||
typed_tab := tab.(*chatTab)
|
typed_tab := tab.(*chatTab)
|
||||||
|
|
||||||
if ok {
|
if ok {
|
||||||
|
b.Append(gtk.NewSeparator(gtk.OrientationVertical))
|
||||||
typed_tab.msgs.Append(b)
|
typed_tab.msgs.Append(b)
|
||||||
if current == muc {
|
if current == muc {
|
||||||
scrollToBottomAfterUpdate(scroller)
|
scrollToBottomAfterUpdate(scroller)
|
||||||
@@ -448,6 +450,9 @@ func main() {
|
|||||||
|
|
||||||
cm := xmpp.NewStreamManager(c, func(c xmpp.Sender) {
|
cm := xmpp.NewStreamManager(c, func(c xmpp.Sender) {
|
||||||
fmt.Println("XMPP client connected")
|
fmt.Println("XMPP client connected")
|
||||||
|
// client = c
|
||||||
|
// clientroot = c
|
||||||
|
|
||||||
// Ping
|
// Ping
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
@@ -730,7 +735,6 @@ func main() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
conc := func() {
|
conc := func() {
|
||||||
// time.Sleep(3 * time.Second)
|
|
||||||
connectionStatus.SetText(loadedLocale["connecting"])
|
connectionStatus.SetText(loadedLocale["connecting"])
|
||||||
connectionIcon.SetFromPaintable(clientAssetsLoad("hourglass"))
|
connectionIcon.SetFromPaintable(clientAssetsLoad("hourglass"))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user