plugin XEP-0363: fix handling of empty upload_jid in _get_slot

This commit is contained in:
Goffi 2023-06-22 15:46:42 +02:00
commit ae0402fd75

View file

@ -300,7 +300,8 @@ class XEP_0363:
client = self.host.get_client(profile_key)
filename = filename.replace("/", "_")
d = defer.ensureDeferred(self.get_slot(
client, filename, size, content_type or None, jid.JID(upload_jid) or None
client, filename, size, content_type or None,
jid.JID(upload_jid) if upload_jid else None
))
d.addCallback(lambda slot: (slot.get, slot.put, slot.headers))
return d