Mercurial > libervia-desktop-kivy
comparison cagou/plugins/plugin_wid_chat.py @ 432:36c3f1c02d33
chat: renamed `MESS_KEY_MEDIA_TYPE` to `MESS_KEY_ATTACHMENTS_MEDIA_TYPE` following backend change
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 01 Mar 2020 22:11:25 +0100 |
parents | d3a6ae859556 |
children | aa204c813f07 |
comparison
equal
deleted
inserted
replaced
431:f3c5e3caa170 | 432:36c3f1c02d33 |
---|---|
103 | 103 |
104 | 104 |
105 class AttachmentItem(BaseAttachmentItem): | 105 class AttachmentItem(BaseAttachmentItem): |
106 | 106 |
107 def get_symbol(self, data): | 107 def get_symbol(self, data): |
108 media_type = data.get(C.MESS_KEY_MEDIA_TYPE, '') | 108 media_type = data.get(C.MESS_KEY_ATTACHMENTS_MEDIA_TYPE, '') |
109 main_type = media_type.split('/', 1)[0] | 109 main_type = media_type.split('/', 1)[0] |
110 if main_type == 'image': | 110 if main_type == 'image': |
111 return "file-image" | 111 return "file-image" |
112 elif main_type == 'video': | 112 elif main_type == 'video': |
113 return "file-video" | 113 return "file-video" |
291 image_attachments = [] | 291 image_attachments = [] |
292 other_attachments = [] | 292 other_attachments = [] |
293 # we first separate images and other attachments, so we know if we need | 293 # we first separate images and other attachments, so we know if we need |
294 # to use an image collection | 294 # to use an image collection |
295 for attachment in attachments: | 295 for attachment in attachments: |
296 media_type = attachment.get(C.MESS_KEY_MEDIA_TYPE, '') | 296 media_type = attachment.get(C.MESS_KEY_ATTACHMENTS_MEDIA_TYPE, '') |
297 main_type = media_type.split('/', 1)[0] | 297 main_type = media_type.split('/', 1)[0] |
298 # GIF images are really badly handled by Kivy, the memory | 298 # GIF images are really badly handled by Kivy, the memory |
299 # consumption explode, and the images frequencies are not handled | 299 # consumption explode, and the images frequencies are not handled |
300 # correctly, thus we can't display them and we consider them as | 300 # correctly, thus we can't display them and we consider them as |
301 # other attachment, so user can open the item with appropriate | 301 # other attachment, so user can open the item with appropriate |