Add nickname fallback for rooms that don't have XEP-0421
This commit is contained in:
@@ -145,6 +145,10 @@ func generateMessageWidget(p stanza.Packet) gtk.Widgetter {
|
||||
ocu := OccupantID{}
|
||||
|
||||
m.Get(&ocu)
|
||||
id := ocu.ID
|
||||
if id == "" {
|
||||
id = JidMustParse(m.From).Resource
|
||||
}
|
||||
|
||||
authorBox := gtk.NewBox(gtk.OrientationHorizontal, 10)
|
||||
contentBox := gtk.NewBox(gtk.OrientationHorizontal, 0)
|
||||
@@ -159,7 +163,7 @@ func generateMessageWidget(p stanza.Packet) gtk.Widgetter {
|
||||
mo, _ := mucmembers.Load(jid.MustParse(m.From).Bare().String())
|
||||
mm := mo.(mucUnit)
|
||||
mmm := mm.Members
|
||||
mmmm, ok := mmm.Load(ocu.ID)
|
||||
mmmm, ok := mmm.Load(id)
|
||||
if ok {
|
||||
pres := mmmm.(stanza.Presence)
|
||||
|
||||
@@ -267,7 +271,7 @@ func getAvatar(j, hash string) *gtk.Image { // TODO: This function probably shou
|
||||
}
|
||||
|
||||
base64_data := card.Photo.Binval
|
||||
if card.Photo.Binval == "" || (card.Photo.Type == "image/svg+xml" && runtime.GOOS == "windows") {
|
||||
if card.Photo.Binval == "" || ((card.Photo.Type == "image/svg+xml" || card.Photo.Type == "image/webp") && (runtime.GOOS == "windows")) {
|
||||
return gtk.NewImageFromPaintable(clientAssets["DefaultAvatar"])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user