t
This commit is contained in:
+19
-13
@@ -171,7 +171,7 @@ func generateMessageWidget(p stanza.Packet) gtk.Widgetter {
|
||||
pres := mmmm.(stanza.Presence)
|
||||
var vu VCardUpdate
|
||||
pres.Get(&vu)
|
||||
im := createIdenticon(m.From)
|
||||
im := createIdenticon(m.From, false)
|
||||
im.SetPixelSize(40)
|
||||
im.AddCSSClass("author_img")
|
||||
authorBox.Append(im)
|
||||
@@ -188,7 +188,7 @@ func generateMessageWidget(p stanza.Packet) gtk.Widgetter {
|
||||
}
|
||||
|
||||
} else {
|
||||
im := createIdenticon(m.From)
|
||||
im := createIdenticon(m.From, false)
|
||||
im.SetPixelSize(40)
|
||||
im.AddCSSClass("author_img")
|
||||
authorBox.Append(im)
|
||||
@@ -199,6 +199,12 @@ func generateMessageWidget(p stanza.Packet) gtk.Widgetter {
|
||||
|
||||
authorBox.Append(al)
|
||||
|
||||
if m.Thread != "" {
|
||||
im := createIdenticon(m.Thread, true)
|
||||
im.SetPixelSize(10)
|
||||
authorBox.Append(im)
|
||||
}
|
||||
|
||||
wxdc := XDCEl{}
|
||||
ok = m.Get(&wxdc)
|
||||
if ok {
|
||||
@@ -288,16 +294,16 @@ func getAvatar(j, hash string) *gtk.Image { // TODO: This function probably shou
|
||||
oghash := hash
|
||||
p, err := ensureCache()
|
||||
if err != nil {
|
||||
return createIdenticon(j)
|
||||
return createIdenticon(j, false)
|
||||
}
|
||||
|
||||
if hash == "" {
|
||||
return createIdenticon(j)
|
||||
return createIdenticon(j, false)
|
||||
}
|
||||
|
||||
_, ok := invalidImages[hash]
|
||||
_, ok := invalidImages.Load(hash)
|
||||
if ok {
|
||||
return createIdenticon(j)
|
||||
return createIdenticon(j, false)
|
||||
}
|
||||
|
||||
hash = filepath.Join(p, hash)
|
||||
@@ -306,8 +312,8 @@ func getAvatar(j, hash string) *gtk.Image { // TODO: This function probably shou
|
||||
if err == nil {
|
||||
i, err := newImageFromPath(hash)
|
||||
if err != nil {
|
||||
invalidImages[oghash] = true
|
||||
return createIdenticon(j)
|
||||
invalidImages.Store(oghash, true)
|
||||
return createIdenticon(j, false)
|
||||
}
|
||||
i.AddCSSClass(loadedConfig.CVD.String() + "_CVD")
|
||||
return i
|
||||
@@ -335,14 +341,14 @@ func getAvatar(j, hash string) *gtk.Image { // TODO: This function probably shou
|
||||
result := <-mychan
|
||||
card, ok := result.Payload.(*VCard)
|
||||
if !ok {
|
||||
return createIdenticon(j)
|
||||
return createIdenticon(j, false)
|
||||
}
|
||||
|
||||
base64_data := card.Photo.Binval
|
||||
if card.Photo.Binval == "" || ((card.Photo.Type == "image/svg+xml" || card.Photo.Type == "image/webp") && (runtime.GOOS == "windows" || runtime.GOOS == "netbsd")) {
|
||||
fmt.Println("Blocking image")
|
||||
invalidImages[oghash] = true
|
||||
return createIdenticon(j)
|
||||
invalidImages.Store(oghash, true)
|
||||
return createIdenticon(j, false)
|
||||
}
|
||||
|
||||
data, err := base64.StdEncoding.DecodeString(base64_data)
|
||||
@@ -357,8 +363,8 @@ func getAvatar(j, hash string) *gtk.Image { // TODO: This function probably shou
|
||||
|
||||
i, err := newImageFromPath(hash)
|
||||
if err != nil {
|
||||
invalidImages[oghash] = true
|
||||
return createIdenticon(j)
|
||||
invalidImages.Store(oghash, true)
|
||||
return createIdenticon(j, false)
|
||||
}
|
||||
i.AddCSSClass(loadedConfig.CVD.String() + "_CVD")
|
||||
return i
|
||||
|
||||
Reference in New Issue
Block a user