Implement bridging Signal and XMPP

This commit is contained in:
2025-02-23 18:34:03 +00:00
parent 8d2f28f571
commit b2b44c31cc
5 changed files with 325 additions and 46 deletions

View File

@@ -69,6 +69,20 @@ class HandleMessage(Command):
# Determine the identifier to use
identifier_uuid = dest if is_from_bot else source_uuid
# Handle attachments
attachments = raw.get("envelope", {}).get("syncMessage", {}).get("sentMessage", {}).get("attachments", [])
attachment_list = []
for attachment in attachments:
attachment_list.append({
"id": attachment["id"],
"content_type": attachment["contentType"],
"filename": attachment["filename"],
"size": attachment["size"],
"width": attachment.get("width"),
"height": attachment.get("height"),
})
cast = {
"type": "def",
@@ -77,6 +91,7 @@ class HandleMessage(Command):
# "sender": source_uuid,
"identifier": identifier_uuid,
"msg": text,
"attachments": attachment_list,
"detail": {
"reply_to_self": reply_to_self,
"reply_to_others": reply_to_others,