Added stop signals to RMASS incoming message flows. Nested attachment handling in its own operation for Synapse outgoing message flows

This commit is contained in:
Lyncoln
2026-10-26 15:17:45 -04:00
parent b9f36eff0a
commit 2b7435527a
19 changed files with 202 additions and 21 deletions
+3 -1
View File
@@ -4,7 +4,9 @@ name = "Get User Avatar"
kind = "action"
alias = "getavatar"
alias = "getrmassuseravatar"
depends = []
allowaction = bool(os.environ.get("UPDATE_AVATARS", True))
+1 -1
View File
@@ -4,7 +4,7 @@ name = "Get message list"
kind = "action"
alias = "pullmessages"
alias = "pullmessagelist"
showstatus = True
+7 -7
View File
@@ -48,17 +48,17 @@ resolve = {
}
keys = [
#{
# "keytitle": "message",
# "keyvalue": {
# "resolved": "message_body",
# },
#},
{
"keytitle": "message",
"keyvalue": "Here's a photo!",
"keyvalue": {
"resolved": "message_body",
},
},
#{
# "keytitle": "message",
# "keyvalue": "Here's a photo!",
#},
#{
# "keytitle": "profileId",
# "keyvalue": {
# "resolved": "rmass_user",
@@ -2,7 +2,11 @@ name = "Upload Attachments to Synapse"
kind = "action"
alias = "uploadattachment"
alias = "rmassuploadattachmenttosynapse"
depends = [
"getrmassattachments",
]
showstatus = True
@@ -4,7 +4,11 @@ name = "Upload Avatar to Synapse"
kind = "action"
alias = "uploadavatar"
alias = "rmassavatartosynapse"
depends = [
"getrmassuseravatar",
]
allowaction = os.environ.get("UPDATE_AVATARS", True)
@@ -0,0 +1,94 @@
name = "Save RMASS Message ID"
kind = "action"
alias = "savermassmessageid"
depends = [
"synapsegetroomalias",
"rmassmessagepush",
"rmassattachmentpush",
]
showstatus = True
isrequest = True
method = "GET"
#Used to resolve path for recursive handling. Path location must match the location of the recursiveset data from pullmessage operation
resolve = {
"get": {
"event_id": ["outmessageitem", "event_id"],
"path": ["lastmessage", 0, "content", "com.loxthelion.rmass_message_id"],
#"matrix_sender": ["outmessageitem", "sender"],
#"msg_type": ["outmessageitem", "type"],
#"echo_tag": ["outmessageitem", "content", "com.loxthelion.rmass_message_id"],
"rmass_sent_status": ["rmass_sent_status"],
},
}
#To add resolution suffix, second item must be a dictionary. References the "path" library under resolved
path = [
"https://rentmasseur.com/api/v1/mailbox/",
{"resolved": "path"},
]
headers = {
"Authorization": {
"output": "access_token",
"prefix": "Bearer ",
},
}
outputs = {
"rmasslastmessages": "messages",
}
extract = {
"get": {
"rmass_message_id": ["rmasslastmessages", 0, "id"],
},
}
#outputs["rmasslastmessages"][0]["id"] is where we get our messageid
select = {
"source": "rmasslastmessages",
"include": {
"key": "senderId",
"value": 238302,
},
"exclude": {
"key": "currentFolder",
"value": 1,
}
}
saverow = {
"table": "message_mapping",
"columns": [
{"rmass_message_id": "INTEGER PRIMARY KEY"},
{"matrix_event_id": "TEXT NOT NULL UNIQUE"},
],
"rowitems": [
{"outputs": "rmass_message_id"},
{"resolved": "event_id"},
],
}
filters = [
{
"filterkey": "rmass_sent_status",
"operator": "==",
"filtervalue": "fail",
"print": f"Failed to send message to RMASS. Bypassing save during {name}...",
},
{
"filterkey": "rmass_sent_status",
"operator": "==",
"filtervalue": "error",
"print": f"Failed to send message to RMASS. Bypassing save during {name}...",
},
]
@@ -2,6 +2,13 @@ import os
name = "Synapse Assign Avatar"
alias = "synapseassignavatar"
depends = [
"getrmassuseravatar",
"rmassavatartosynapse",
]
kind = "action"
showstatus = True
@@ -2,6 +2,15 @@ import os
name = "Synapse Assign DM Room Avatar"
alias = "synapseassigndmavatar"
depends = [
"getrmassuseravatar",
"rmassavatartosynapse",
"synapsegetroomid",
"synapsecreatedmroom",
]
kind = "action"
showstatus = True
@@ -6,6 +6,10 @@ kind = "action"
showstatus = True
alias = "synapseassignusername"
#depends = []
#astoken = os.environ["AS_TOKEN"]
resolve = {
@@ -6,6 +6,10 @@ kind = "action"
showstatus = True
alias = "synapsecreatedmroom"
depends = []
resolve = {
"get": {
"sender": ["messageheaders", "userCard", "id"],
@@ -6,7 +6,6 @@ kind = "action"
depends = [
"synapsegetroomalias",
"rmassmessagepush",
]
showstatus = True
@@ -4,6 +4,12 @@ name = "Synapse Get Room ID"
kind = "action"
alias = "synapsegetroomid"
#depends = [
# "synapsecreatedmroom",
#]
showstatus = True
resolve = {
@@ -2,6 +2,13 @@ from . import synapsenotify
name = "Synapse Attachment Push"
alias = "synapsepushattachments"
depends = [
"getrmassattachments",
"rmassattachmenttosynapse",
]
kind = "action"
showstatus = True
+4
View File
@@ -6,6 +6,10 @@ kind = "action"
showstatus = True
alias = "synapseregister"
#depends = []
resolve = {
"get": {
"sender": ["messageheaders", "userCard", "id"],