# HG changeset patch # User Goffi # Date 1680953695 -7200 # Node ID 962d17c4078ca550f7d4cfa9dc3cb845586d08e2 # Parent 8f3cb8cd84d6cc9c50d6941a0602e5aaa0b9c19b chat: changed KEY_ATTACHEMENTS* name following backend change diff -r 8f3cb8cd84d6 -r 962d17c4078c cagou/plugins/plugin_wid_chat.py --- a/cagou/plugins/plugin_wid_chat.py Fri Apr 07 15:22:31 2023 +0200 +++ b/cagou/plugins/plugin_wid_chat.py Sat Apr 08 13:34:55 2023 +0200 @@ -115,7 +115,7 @@ class AttachmentItem(BaseAttachmentItem): def get_symbol(self, data): - media_type = data.get(C.MESS_KEY_ATTACHMENTS_MEDIA_TYPE, '') + media_type = data.get(C.KEY_ATTACHMENTS_MEDIA_TYPE, '') main_type = media_type.split('/', 1)[0] if main_type == 'image': return "file-image" @@ -348,7 +348,7 @@ # we first separate images and other attachments, so we know if we need # to use an image collection for attachment in attachments: - media_type = attachment.get(C.MESS_KEY_ATTACHMENTS_MEDIA_TYPE, '') + media_type = attachment.get(C.KEY_ATTACHMENTS_MEDIA_TYPE, '') main_type = media_type.split('/', 1)[0] # GIF images are really badly handled by Kivy, the memory # consumption explode, and the images frequencies are not handled @@ -984,17 +984,17 @@ continue item.sending = True progress_id = item.data["progress_id"] = str(uuid.uuid4()) - attachments = extra.setdefault(C.MESS_KEY_ATTACHMENTS, []) + attachments = extra.setdefault(C.KEY_ATTACHMENTS, []) attachment = { "path": str(item.data["path"]), "progress_id": progress_id, } if 'media_type' in item.data: - attachment[C.MESS_KEY_ATTACHMENTS_MEDIA_TYPE] = item.data['media_type'] + attachment[C.KEY_ATTACHMENTS_MEDIA_TYPE] = item.data['media_type'] if ((self.attachments_to_send.reduce_checkbox.active and attachment.get('media_type', '').split('/')[0] == 'image')): - attachment[C.MESS_KEY_ATTACHMENTS_RESIZE] = True + attachment[C.KEY_ATTACHMENTS_RESIZE] = True attachments.append(attachment)