Mercurial > libervia-backend
diff sat/plugins/plugin_xep_0234.py @ 3345:3dc8835d96cc
plugin XEP-0234: fixed mime type in `buildFileElementFromDict`
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 25 Aug 2020 08:51:35 +0200 |
parents | ac9342f359e9 |
children | 404d4b29de52 |
line wrap: on
line diff
--- a/sat/plugins/plugin_xep_0234.py Sat Aug 15 22:54:42 2020 +0200 +++ b/sat/plugins/plugin_xep_0234.py Tue Aug 25 08:51:35 2020 +0200 @@ -179,6 +179,12 @@ if kwargs: file_data = file_data.copy() file_data.update(kwargs) + try: + file_data["mime_type"] = ( + f'{file_data.pop("media_type")}/{file_data.pop("media_subtype")}' + ) + except KeyError: + pass return self.buildFileElement(client, **file_data) async def parseFileElement(