Reformatted code base using black.

This commit is contained in:
Goffi 2024-06-19 18:44:57 +02:00
commit 53fdaa9d09

View file

@ -185,12 +185,13 @@ class XEP_0231(object):
client.send(error_elt)
return
with open(metadata["path"], 'rb') as f:
with open(metadata["path"], "rb") as f:
data = f.read()
result_elt = xmlstream.toResponse(iq_elt, "result")
data_elt = result_elt.addElement(
(NS_BOB, "data"), content=base64.b64encode(data).decode())
(NS_BOB, "data"), content=base64.b64encode(data).decode()
)
data_elt["cid"] = cid
data_elt["type"] = metadata["mime_type"]
data_elt["max-age"] = str(int(max(0, metadata["eol"] - time.time())))
@ -240,7 +241,9 @@ class XEP_0231_handler(xmlstream.XMPPHandler):
def connectionInitialized(self):
if self.parent.is_component:
self.xmlstream.addObserver(
IQ_BOB_REQUEST, self.plugin_parent.on_component_request, client=self.parent
IQ_BOB_REQUEST,
self.plugin_parent.on_component_request,
client=self.parent,
)
def getDiscoInfo(self, requestor, target, nodeIdentifier=""):