diff sat/plugins/plugin_xep_0054.py @ 3326:9e1ba1e1179f

plugin identity: added "filename" metadata for avatar
author Goffi <goffi@goffi.org>
date Sun, 02 Aug 2020 17:40:07 +0200
parents 8de63fe6b5c9
children be6d91572633
line wrap: on
line diff
--- a/sat/plugins/plugin_xep_0054.py	Sat Aug 01 16:25:50 2020 +0200
+++ b/sat/plugins/plugin_xep_0054.py	Sun Aug 02 17:40:07 2020 +0200
@@ -211,6 +211,7 @@
                             "avatar",
                             {
                                 'path': avatar_cache['path'],
+                                'filename': avatar_cache['filename'],
                                 'media_type': avatar_cache['mime_type'],
                                 'cache_uid': avatar_hash
                             },
@@ -364,6 +365,7 @@
         ) as f:
             f.write(img_buf.read())
             avatar_data['path'] = Path(f.name)
+            avatar_data['filename'] = avatar_data['path'].name
         avatar_data['cache_uid'] = image_hash
         return image_hash
 
@@ -512,6 +514,7 @@
                 IMPORT_NAME, "avatar",
                 {
                     'path': avatar_cache['path'],
+                    'filename': avatar_cache['filename'],
                     'media_type': avatar_cache['mime_type'],
                     'cache_uid': new_hash,
                 },