changeset 490:962d17c4078c

chat: changed KEY_ATTACHEMENTS* name following backend change
author Goffi <goffi@goffi.org>
date Sat, 08 Apr 2023 13:34:55 +0200
parents 8f3cb8cd84d6
children 203755bbe0fe
files cagou/plugins/plugin_wid_chat.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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)