Remove some debug statements
This commit is contained in:
@@ -296,7 +296,7 @@ class EchoComponent(ComponentXMPP):
|
||||
self.connect()
|
||||
|
||||
def session_start(self, *args):
|
||||
log.info(f"START {args}")
|
||||
log.info(f"Session started: {args}")
|
||||
|
||||
async def request_upload_slot(self, recipient, filename, content_type, size):
|
||||
"""
|
||||
@@ -332,8 +332,6 @@ class EchoComponent(ComponentXMPP):
|
||||
log.error(f"Failed to obtain upload slot for {filename}")
|
||||
return None
|
||||
|
||||
log.info(f"Slot: {slot}")
|
||||
|
||||
# Parse the XML response
|
||||
root = ET.fromstring(str(slot)) # Convert to string if necessary
|
||||
namespace = "{urn:xmpp:http:upload:0}" # Define the namespace
|
||||
@@ -342,8 +340,6 @@ class EchoComponent(ComponentXMPP):
|
||||
put_element = root.find(f".//{namespace}put")
|
||||
put_url = put_element.attrib.get("url")
|
||||
|
||||
log.info(f"Put element: {ET.tostring(put_element, encoding='unicode')}") # Debugging
|
||||
|
||||
# Extract the Authorization header correctly
|
||||
header_element = put_element.find(f"./{namespace}header[@name='Authorization']")
|
||||
auth_header = header_element.text.strip() if header_element is not None else None
|
||||
@@ -352,8 +348,6 @@ class EchoComponent(ComponentXMPP):
|
||||
log.error(f"Missing URLs in upload slot: {slot}")
|
||||
return None
|
||||
|
||||
log.info(f"Got upload slot: {get_url}, Authorization: {auth_header}")
|
||||
|
||||
return get_url, put_url, auth_header
|
||||
|
||||
except Exception as e:
|
||||
@@ -499,11 +493,10 @@ class EchoComponent(ComponentXMPP):
|
||||
text_msg["body"] = text
|
||||
log.info(f"Sending separate text message: {text}")
|
||||
if detail.is_outgoing_message:
|
||||
log.info("OUT")
|
||||
log.info("Outgoing message, not forwarding")
|
||||
...
|
||||
else:
|
||||
log.info(f"Final XMPP message: {text_msg.xml}")
|
||||
log.info(f"Sending message")
|
||||
text_msg.send()
|
||||
|
||||
for att in attachments:
|
||||
@@ -541,11 +534,10 @@ class EchoComponent(ComponentXMPP):
|
||||
|
||||
log.info(f"Sending file attachment message with URL: {upload_url}")
|
||||
if detail.is_outgoing_message:
|
||||
log.info("OUT")
|
||||
log.info("Outgoing message, not forwarding")
|
||||
...
|
||||
else:
|
||||
log.info(f"Final XMPP message: {msg.xml}")
|
||||
log.info(f"Sending message")
|
||||
msg.send()
|
||||
|
||||
except Exception as e:
|
||||
@@ -559,12 +551,10 @@ async def stream(**kwargs):
|
||||
message = await pubsub.get_message(ignore_subscribe_messages=True)
|
||||
if message is not None:
|
||||
try:
|
||||
log.info("GOT", message)
|
||||
data = message["data"]
|
||||
unpacked = msgpack.unpackb(data, raw=False)
|
||||
log.info(f"Unpacked: {unpacked}")
|
||||
except TypeError:
|
||||
log.info(f"FAILED {message}")
|
||||
continue
|
||||
if "type" in unpacked.keys():
|
||||
if unpacked["type"] == "def":
|
||||
|
||||
@@ -39,7 +39,6 @@ class HandleMessage(Command):
|
||||
"mentions": c.message.mentions,
|
||||
"raw_message": c.message.raw_message
|
||||
}
|
||||
log.info("1")
|
||||
raw = json.loads(c.message.raw_message)
|
||||
print(json.dumps(c.message.raw_message, indent=2))
|
||||
#dest = c.message.raw_message.get("envelope", {}).get("syncMessage", {}).get("sentMessage", {}).get("destinationUuid")
|
||||
@@ -47,10 +46,8 @@ class HandleMessage(Command):
|
||||
|
||||
#account = c.message.raw_message.get("account", "")
|
||||
account = raw.get("account", "")
|
||||
log.info("2")
|
||||
#source_name = msg["raw_message"].get("envelope", {}).get("sourceName", "")
|
||||
source_name = raw.get("envelope", {}).get("sourceName", "")
|
||||
log.info("3")
|
||||
|
||||
source_number = c.message.source_number
|
||||
source_uuid = c.message.source_uuid
|
||||
@@ -158,7 +155,6 @@ class HandleMessage(Command):
|
||||
text=result,
|
||||
ts=ts + 1,
|
||||
)
|
||||
# log.info("NOT SENDING CHECK CODE IS OK")
|
||||
# await natural.natural_send_message(c, result)
|
||||
tss = await natural.natural_send_message(
|
||||
result,
|
||||
@@ -236,12 +232,9 @@ async def stream():
|
||||
message = await pubsub.get_message(ignore_subscribe_messages=True)
|
||||
if message is not None:
|
||||
try:
|
||||
log.info("GOT", message)
|
||||
data = message["data"]
|
||||
unpacked = msgpack.unpackb(data, raw=False)
|
||||
log.info(f"Unpacked: {unpacked}")
|
||||
except TypeError:
|
||||
log.info(f"FAILED {message}")
|
||||
continue
|
||||
if "type" in unpacked.keys():
|
||||
if unpacked["type"] == "def":
|
||||
|
||||
Reference in New Issue
Block a user