debugging

This commit is contained in:
2019-03-10 17:29:57 +01:00
parent 57b4a680f0
commit 33553d9db0

View File

@@ -166,9 +166,7 @@ class XMPPTelegram(ComponentXMPP):
# detect media # detect media
if "oob" in iq: try:
logging.debug("Found OOB content in message")
if "url" in iq['oob']:
url = iq['oob']['url'] url = iq['oob']['url']
logging.debug("Found OOB URL: {}".format(url)) logging.debug("Found OOB URL: {}".format(url))
if url.split('.')[-1] in self.config['media_external_formats']: if url.split('.')[-1] in self.config['media_external_formats']:
@@ -178,6 +176,8 @@ class XMPPTelegram(ComponentXMPP):
result = self.tg_connections[jid].invoke(SendMediaRequest(tg_peer, media, "Image", random_id = generate_random_long(), reply_to_msg_id = reply_mid)) result = self.tg_connections[jid].invoke(SendMediaRequest(tg_peer, media, "Image", random_id = generate_random_long(), reply_to_msg_id = reply_mid))
except Exception: except Exception:
print('Media upload failed.') print('Media upload failed.')
except KeyError:
logging.debug("No OOB found")
# media send failed. # # media send failed. #
if not result: if not result: