comparison 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
comparison
equal deleted inserted replaced
3344:7515e1878004 3345:3dc8835d96cc
177 @param **kwargs: data to override 177 @param **kwargs: data to override
178 """ 178 """
179 if kwargs: 179 if kwargs:
180 file_data = file_data.copy() 180 file_data = file_data.copy()
181 file_data.update(kwargs) 181 file_data.update(kwargs)
182 try:
183 file_data["mime_type"] = (
184 f'{file_data.pop("media_type")}/{file_data.pop("media_subtype")}'
185 )
186 except KeyError:
187 pass
182 return self.buildFileElement(client, **file_data) 188 return self.buildFileElement(client, **file_data)
183 189
184 async def parseFileElement( 190 async def parseFileElement(
185 self, client, file_elt, file_data=None, given=False, parent_elt=None, 191 self, client, file_elt, file_data=None, given=False, parent_elt=None,
186 keep_empty_range=False): 192 keep_empty_range=False):