57 lines
1.5 KiB
Python
57 lines
1.5 KiB
Python
name = "Get Last Synapse Message"
|
|
|
|
kind = "action"
|
|
|
|
showstatus = True
|
|
|
|
isrequest = True
|
|
|
|
method = "GET"
|
|
|
|
resolve = {
|
|
"get": {
|
|
#"sender": ["room_name"],
|
|
#"event_id": ["outmessageitem", "event_id"],
|
|
#"message_body": ["outmessageitem", "content", "body"],
|
|
"room_id": ["outmessageitem", "room_id"],
|
|
#"timestamp": ["outmessageitem", "origin_server_ts"],
|
|
#"matrix_sender": ["outmessageitem", "sender"],
|
|
#"msg_type": ["outmessageitem", "type"],
|
|
#"echo_tag": ["outmessageitem", "content", "com.loxthelion.rmass_message_id"],
|
|
"rmass_sent_status": ["rmass_sent_status"],
|
|
},
|
|
}
|
|
|
|
path = [
|
|
"https://loxthelion.com/_matrix/client/v3/rooms/",
|
|
{"resolved": "room_id"},
|
|
"/messages?dir=b&limit=1&filter=%7B%22types%22%3A%5B%22m.room.message%22%5D%2C%22not_senders%22%3A%5B%22%40lyncoln%3Aloxthelion.com%22%2C%22%40rmass_bridge%3Aloxthelion.com%22%5D%7D",
|
|
]
|
|
|
|
headers = {
|
|
"Authorization": {
|
|
"os": "ADMIN_TOKEN",
|
|
"prefix": "Bearer ",
|
|
},
|
|
"Content-Type": "application/json",
|
|
}
|
|
|
|
outputs = {
|
|
"lastmessage": "chunk"
|
|
}
|
|
|
|
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}...",
|
|
},
|
|
]
|