Philipp Hörist pushed to branch master at gajim / gajim


Commits:
325198e7 by lovetox at 2022-05-15T13:25:00+02:00
fix: Avatar: Fallback to default avatar when image is missing

- - - - -


1 changed file:

- gajim/gtk/avatar.py


Changes:

=====================================
gajim/gtk/avatar.py
=====================================
@@ -439,11 +439,14 @@ def get_muc_surface(self,
             avatar_sha = app.storage.cache.get_muc(jid, 'avatar')
             if avatar_sha is not None:
                 surface = self.surface_from_filename(avatar_sha, size, scale)
-                if surface is None:
-                    return None
-                surface = clip(surface, style)
-                self._cache[jid][(size, scale)] = surface
-                return surface
+                if surface is not None:
+                    surface = clip(surface, style)
+                    self._cache[jid][(size, scale)] = surface
+                    return surface
+
+                # avatar_sha set, but image is missing
+                # (e.g. avatar cache deleted)
+                app.storage.cache.set_muc(jid, 'avatar', None)
 
         con = app.connections[account]
         name = get_groupchat_name(con, jid)



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/325198e7302cd10c2e28046c92bc8ae32206fcda

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/325198e7302cd10c2e28046c92bc8ae32206fcda
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to