Implement bridging Signal and XMPP
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user