# HG changeset patch # User Goffi # Date 1584559581 -3600 # Node ID ffdf2390ea56193ca4e3393e081635a65c4dcf90 # Parent 9b73a18799892c42131b94c075890dc6c41f290f chat: fixed `source` assignment for `AttachmentImageItem` diff -r 9b73a1879989 -r ffdf2390ea56 cagou/plugins/plugin_wid_chat.py --- a/cagou/plugins/plugin_wid_chat.py Wed Mar 18 20:26:21 2020 +0100 +++ b/cagou/plugins/plugin_wid_chat.py Wed Mar 18 20:26:21 2020 +0100 @@ -132,10 +132,15 @@ gallery = ImagesGallery(sources=[full_size_source]) G.host.showExtraUI(gallery) + def on_kv_post(self, __): + self.on_data(None, self.data) + def on_data(self, __, data): + if self.image is None: + return source = data.get('preview') or data.get('path') or data.get('url') if source: - self.source = source + self.image.source = source class AttachmentImagesCollectionItem(ButtonBehavior, GridLayout):