forked from sunglocto/lambda
uhh
This commit is contained in:
@@ -71,6 +71,7 @@ func generateMessageWidget(p stanza.Packet) gtk.Widgetter {
|
||||
}
|
||||
|
||||
ocu := OccupantID{}
|
||||
|
||||
m.Get(&ocu)
|
||||
|
||||
authorBox := gtk.NewBox(gtk.OrientationHorizontal, 10)
|
||||
@@ -78,10 +79,32 @@ func generateMessageWidget(p stanza.Packet) gtk.Widgetter {
|
||||
// im := newImageFromPath("debug.png")
|
||||
|
||||
// authorBox.Append(im)
|
||||
im := getAvatar(m.From, ocu.ID)
|
||||
im.SetPixelSize(40)
|
||||
im.AddCSSClass("author_img")
|
||||
authorBox.Append(im)
|
||||
|
||||
mo, _ := mucmembers.Load(jid.MustParse(m.From).Bare().String())
|
||||
mm := mo.(mucUnit)
|
||||
mmm := mm.Members
|
||||
mmmm, ok := mmm.Load(ocu.ID)
|
||||
if ok {
|
||||
pres := mmmm.(stanza.Presence)
|
||||
|
||||
var vu VCardUpdate
|
||||
pres.Get(&vu)
|
||||
if vu.Photo != "" {
|
||||
im := getAvatar(m.From, vu.Photo)
|
||||
im.SetPixelSize(40)
|
||||
im.AddCSSClass("author_img")
|
||||
authorBox.Append(im)
|
||||
} else {
|
||||
im := newImageFromPath("debug.png")
|
||||
im.SetPixelSize(40)
|
||||
im.AddCSSClass("author_img")
|
||||
}
|
||||
} else {
|
||||
im := newImageFromPath("debug.png")
|
||||
im.SetPixelSize(40)
|
||||
im.AddCSSClass("author_img")
|
||||
}
|
||||
|
||||
al := gtk.NewLabel(jid.MustParse(m.From).Resourcepart())
|
||||
al.AddCSSClass("author")
|
||||
|
||||
@@ -128,6 +151,11 @@ func getAvatar(j, hash string) *gtk.Image { // TODO: This function probably shou
|
||||
return newImageFromPath("debug.png")
|
||||
}
|
||||
|
||||
if hash == "" {
|
||||
fmt.Println("Hash is nil!")
|
||||
return newImageFromPath("debug.png")
|
||||
}
|
||||
|
||||
hash = filepath.Join(p, sanitizefilename.Sanitize(hash))
|
||||
|
||||
_, err = os.ReadFile(hash)
|
||||
|
||||
Reference in New Issue
Block a user