# HG changeset patch # User Goffi # Date 1582991722 -3600 # Node ID adf1aeaa0d3775830578305542481719996785c9 # Parent 29d72336a40d6d8f7c18239c78500a560858cce8 core (constants): renamed `MESS_KEY_MEDIA_TYPE` to `MESS_KEY_ATTACHMENTS_MEDIA_TYPE` diff -r 29d72336a40d -r adf1aeaa0d37 sat/core/constants.py --- a/sat/core/constants.py Fri Feb 28 18:10:58 2020 +0100 +++ b/sat/core/constants.py Sat Feb 29 16:55:22 2020 +0100 @@ -134,7 +134,7 @@ MESS_KEY_TRUSTED = "trusted" MESS_KEY_ATTACHMENTS = "attachments" - MESS_KEY_MEDIA_TYPE = "media_type" + MESS_KEY_ATTACHMENTS_MEDIA_TYPE = "media_type" # File encryption algorithms ENC_AES_GCM = "AES-GCM" diff -r 29d72336a40d -r adf1aeaa0d37 sat/core/xmpp.py --- a/sat/core/xmpp.py Fri Feb 28 18:10:58 2020 +0100 +++ b/sat/core/xmpp.py Sat Feb 29 16:55:22 2020 +0100 @@ -1137,10 +1137,10 @@ name = (Path(unquote(urlparse(attachment['url']).path)).name or C.FILE_DEFAULT_NAME) attachment["name"] = name - if C.MESS_KEY_MEDIA_TYPE not in attachment: + if C.MESS_KEY_ATTACHMENTS_MEDIA_TYPE not in attachment: media_type = mimetypes.guess_type(attachment['name'], strict=False)[0] if media_type: - attachment[C.MESS_KEY_MEDIA_TYPE] = media_type + attachment[C.MESS_KEY_ATTACHMENTS_MEDIA_TYPE] = media_type return data def skipEmptyMessage(self, data): diff -r 29d72336a40d -r adf1aeaa0d37 sat/plugins/plugin_sec_aesgcm.py --- a/sat/plugins/plugin_sec_aesgcm.py Fri Feb 28 18:10:58 2020 +0100 +++ b/sat/plugins/plugin_sec_aesgcm.py Sat Feb 29 16:55:22 2020 +0100 @@ -236,7 +236,7 @@ } media_type = mimetypes.guess_type(path, strict=False)[0] if media_type is not None: - attachment[C.MESS_KEY_MEDIA_TYPE] = media_type + attachment[C.MESS_KEY_ATTACHMENTS_MEDIA_TYPE] = media_type if mess_encrypted: # we don't add the encrypted flag if the message itself is not