88 lines
1.9 KiB
Python
88 lines
1.9 KiB
Python
name = "Get Synapse Room Alias"
|
|
|
|
kind = "action"
|
|
|
|
showstatus = True
|
|
|
|
alias = "synapsegetroomalias"
|
|
|
|
## PRE-RUNTIME ACTIONS
|
|
|
|
resolve = {
|
|
"get": {
|
|
"room_id": ["outmessageitem", "room_id"],
|
|
# "matrix_sender": ["outmessageitem", "sender"],
|
|
# "msg_type": ["outmessageitem", "type"],
|
|
"event_id": ["outmessageitem", "event_id"],
|
|
},
|
|
}
|
|
|
|
## RUNTIME ACTIONS
|
|
|
|
isrequest = True
|
|
|
|
method = "GET"
|
|
|
|
path = [
|
|
"https://loxthelion.com/_matrix/client/v3/rooms/",
|
|
{"resolved": "room_id"},
|
|
"/state/m.room.canonical_alias",
|
|
"?user_id=%40rmass_bridge%3Aloxthelion.com"
|
|
]
|
|
|
|
headers = {
|
|
"Authorization": {
|
|
"os": "AS_TOKEN",
|
|
"prefix": "Bearer ",
|
|
},
|
|
"Content-Type": "application/json",
|
|
}
|
|
|
|
## POST-RUNTIME ACTIONS
|
|
|
|
outputs = {
|
|
"room_alias": "alias"
|
|
}
|
|
|
|
readrow = {
|
|
"table": "message_mapping",
|
|
"columns": [
|
|
{"rmass_message_id": "INTEGER PRIMARY KEY"},
|
|
{"matrix_event_id": "TEXT NOT NULL UNIQUE"},
|
|
],
|
|
"searchcolumn": "matrix_event_id",
|
|
"rowsearchvalue": [
|
|
{"resolved": "event_id"},
|
|
],
|
|
"export": {
|
|
1: "db_event_id",
|
|
}
|
|
}
|
|
|
|
filters = [
|
|
{
|
|
"filterkey": "event_id",
|
|
"operator": "==",
|
|
"filtervalue": {"outputs": "db_event_id"},
|
|
"print": f"Message already delivered. Bypassing {name}",
|
|
},
|
|
# {
|
|
# "filterkey": "matrix_sender",
|
|
# "operator": "!=",
|
|
# "filtervalue": "@lyncoln:loxthelion.com",
|
|
# "print": f"Excluding message loop item during {name}",
|
|
# },
|
|
# {
|
|
# "filterkey": "msg_type",
|
|
# "operator": "!=",
|
|
# "filtervalue": "m.room.message",
|
|
# "print": f"Excluding non-room message event during {name}",
|
|
# },
|
|
# {
|
|
# "filterkey": "echo_tag",
|
|
# "operator": "is not",
|
|
# "filtervalue": None,
|
|
# "print": f"Excluding imported message event during {name}",
|
|
# },
|
|
]
|