Matrix bridge working and effectively pushing messages
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,3 @@
|
||||
import os
|
||||
|
||||
|
||||
name = "Get messages"
|
||||
|
||||
kind = "action"
|
||||
@@ -9,11 +6,12 @@ showstatus = True
|
||||
|
||||
method = "GET"
|
||||
|
||||
#Used to resolve path for recursive handling. Path location must match the location of the recursiveset data from pullmessage operation
|
||||
resolve = {
|
||||
"path": ["messageheaders", "id"],
|
||||
#"label": "path",
|
||||
}
|
||||
|
||||
#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"},
|
||||
@@ -24,8 +22,6 @@ path = [
|
||||
#}
|
||||
]
|
||||
|
||||
#path = os.path.join(baseurl.messageid)
|
||||
|
||||
headers = {
|
||||
"Authorization": {
|
||||
"output": "access_token",
|
||||
|
||||
@@ -2,43 +2,12 @@ name = "Get message list"
|
||||
|
||||
kind = "action"
|
||||
|
||||
id = "getmessagelist"
|
||||
|
||||
showstatus = True
|
||||
|
||||
#skipstep = {
|
||||
# "checkavailable": "validTo >= 3600"
|
||||
#}
|
||||
|
||||
#availabletime = int(os.environ.get("AVAILABLE_DURATION",3))
|
||||
|
||||
#duration = availabletime - 1
|
||||
|
||||
#keys = [
|
||||
# {
|
||||
# "keytitle": "option",
|
||||
# "keyvalue": 1,
|
||||
# },
|
||||
# {
|
||||
# "keytitle": "duration",
|
||||
# "keyvalue": duration,
|
||||
# },
|
||||
#]
|
||||
|
||||
method = "GET"
|
||||
|
||||
#path = "https://rentmasseur.com/api/v1/mailbox?page=1&folder=1&sort=1"
|
||||
path = "https://rentmasseur.com/api/v1/mailbox"
|
||||
|
||||
|
||||
#path = [
|
||||
# "https://rentmasseur.com/api/v1/mailbox/",
|
||||
# {
|
||||
# "output": "emails",
|
||||
# "keys": [0, "id"]
|
||||
# }
|
||||
#]
|
||||
|
||||
headers = {
|
||||
"Authorization": {
|
||||
"output": "access_token",
|
||||
@@ -46,13 +15,6 @@ headers = {
|
||||
},
|
||||
}
|
||||
|
||||
#select = {
|
||||
# "source": "emails",
|
||||
# "selectmethod": "exclude",
|
||||
# "key": "unread",
|
||||
# "value": 0,
|
||||
#}
|
||||
|
||||
select = {
|
||||
"source": "emails",
|
||||
"include": {
|
||||
@@ -69,6 +31,3 @@ outputs = {
|
||||
"emails": "emails"
|
||||
}
|
||||
|
||||
#prints = {
|
||||
# "messageid": "id"
|
||||
#}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
import os
|
||||
|
||||
name = "Synapse Assign Username"
|
||||
|
||||
kind = "action"
|
||||
|
||||
showstatus = True
|
||||
|
||||
astoken = os.environ["AS_TOKEN"]
|
||||
|
||||
resolve = {
|
||||
"sender": ["messages", 0, "senderId"],
|
||||
#"messageid": ["message", "id"],
|
||||
"username": ["profile", "username"],
|
||||
#"location": ["profile", "location"],
|
||||
}
|
||||
keys = [
|
||||
#{
|
||||
# "keytitle": "type",
|
||||
# "keyvalue": "m.login.application_service",
|
||||
#},
|
||||
{
|
||||
"keytitle": "displayname",
|
||||
"keyvalue": {
|
||||
"resolved": "username",
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
method = "PUT"
|
||||
|
||||
#path = [
|
||||
# "https://loxthelion.com/_matrix/client/v3/profile/rmass_",
|
||||
# {"resolved": "sender"},
|
||||
# {"suffix": "/displayname"},
|
||||
#]
|
||||
path = [
|
||||
"https://loxthelion.com/_matrix/client/v3/profile/@rmass_",
|
||||
{"resolved": "sender"},
|
||||
":loxthelion.com/displayname?user_id=@rmass_",
|
||||
{"resolved": "sender"},
|
||||
":loxthelion.com"
|
||||
]
|
||||
|
||||
headers = {
|
||||
"Authorization": {
|
||||
"os": "AS_TOKEN",
|
||||
"prefix": "Bearer ",
|
||||
},
|
||||
"Content-Type": "application/json",
|
||||
}
|
||||
|
||||
#outputs = {
|
||||
# "user_id": "user_id",
|
||||
#}
|
||||
@@ -0,0 +1,76 @@
|
||||
import os
|
||||
|
||||
name = "Synapse Create DM Room"
|
||||
|
||||
kind = "action"
|
||||
|
||||
showstatus = True
|
||||
|
||||
astoken = os.environ["AS_TOKEN"]
|
||||
|
||||
resolve = {
|
||||
"sender": ["messages", 0, "senderId"],
|
||||
#"messageid": ["message", "id"],
|
||||
"username": ["profile", "username"],
|
||||
#"location": ["profile", "location"],
|
||||
}
|
||||
keys = [
|
||||
{
|
||||
"keytitle": "name",
|
||||
"keyvalue": {
|
||||
"resolved": "username",
|
||||
},
|
||||
},
|
||||
{
|
||||
"keytitle": "room_alias_name",
|
||||
"keyvalue": {
|
||||
"resolved": "sender",
|
||||
"prefix": "rmass_dmtest_",
|
||||
},
|
||||
},
|
||||
{
|
||||
"keytitle": "visibility",
|
||||
"keyvalue": "private",
|
||||
},
|
||||
{
|
||||
"keytitle": "preset",
|
||||
"keyvalue": "private_chat",
|
||||
},
|
||||
{
|
||||
"keytitle": "is_direct",
|
||||
"keyvalue": True,
|
||||
},
|
||||
{
|
||||
"keytitle": "invite",
|
||||
"keyvalue": ["@lyncoln:loxthelion.com"],
|
||||
},
|
||||
#{
|
||||
#"keytitle": "power_level_content_override",
|
||||
#"keyvalue": {
|
||||
#"users": {
|
||||
#"@lyncoln:loxthelion.com": 100,
|
||||
#"@rmass_:loxthelion.com": 100,
|
||||
#},
|
||||
#},
|
||||
#}
|
||||
]
|
||||
|
||||
method = "POST"
|
||||
|
||||
path = [
|
||||
"https://loxthelion.com/_matrix/client/v3/createRoom?user_id=@rmass_",
|
||||
{"resolved": "sender"},
|
||||
":loxthelion.com",
|
||||
]
|
||||
|
||||
headers = {
|
||||
"Authorization": {
|
||||
"os": "AS_TOKEN",
|
||||
"prefix": "Bearer ",
|
||||
},
|
||||
"Content-Type": "application/json",
|
||||
}
|
||||
|
||||
outputs = {
|
||||
"room_id": "room_id",
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import os
|
||||
|
||||
name = "Synapse Get Room ID"
|
||||
|
||||
kind = "action"
|
||||
|
||||
showstatus = True
|
||||
|
||||
#astoken = os.environ["AS_TOKEN"]
|
||||
|
||||
resolve = {
|
||||
"sender": ["messages", 0, "senderId"],
|
||||
#"message_id": ["messages", 0, "id"],
|
||||
#"username": ["profile", "username"],
|
||||
#"message_body": ["messages", 0, "text"],
|
||||
#"room_id": ["room_id"],
|
||||
#"location": ["profile", "location"],
|
||||
}
|
||||
|
||||
method = "GET"
|
||||
|
||||
path = [
|
||||
"https://loxthelion.com/_matrix/client/v3/directory/room/%23rmass_dmtest_",
|
||||
{"resolved": "sender"},
|
||||
"%3Aloxthelion.com",
|
||||
]
|
||||
|
||||
headers = {
|
||||
"Authorization": {
|
||||
"os": "AS_TOKEN",
|
||||
"prefix": "Bearer ",
|
||||
},
|
||||
"Content-Type": "application/json",
|
||||
}
|
||||
|
||||
outputs = {
|
||||
"room_id": "room_id",
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
import os
|
||||
|
||||
name = "Synapse Message Push"
|
||||
|
||||
kind = "action"
|
||||
|
||||
showstatus = True
|
||||
|
||||
astoken = os.environ["AS_TOKEN"]
|
||||
|
||||
resolve = {
|
||||
"sender": ["message", "senderId"],
|
||||
#"messageid": ["message", "id"],
|
||||
"username": ["profile", "username"],
|
||||
"location": ["profile", "location"],
|
||||
}
|
||||
keys = [
|
||||
{
|
||||
"keytitle": "type",
|
||||
"keyvalue": ,
|
||||
},
|
||||
{
|
||||
"keytitle": "username",
|
||||
"keyvalue": {outputs: senderId},
|
||||
},
|
||||
{
|
||||
"keytitle": "csrf",
|
||||
"keyvalue": {
|
||||
"outputs": "csrf_token",
|
||||
},
|
||||
},
|
||||
{
|
||||
"keytitle": "remember",
|
||||
"keyvalue": 1,
|
||||
},
|
||||
]
|
||||
|
||||
method = "POST"
|
||||
|
||||
path = "https://rentmasseur.com/api/v1/login"
|
||||
|
||||
outputs = {
|
||||
"access_token": "accessToken",
|
||||
"refresh_token": "refreshToken",
|
||||
}
|
||||
|
||||
savedata = [
|
||||
"access_token",
|
||||
"refresh_token",
|
||||
]
|
||||
|
||||
savepath = os.environ["TOKEN_STORE"]
|
||||
@@ -0,0 +1,54 @@
|
||||
import os
|
||||
|
||||
name = "Synapse Message Push"
|
||||
|
||||
kind = "action"
|
||||
|
||||
showstatus = True
|
||||
|
||||
#astoken = os.environ["AS_TOKEN"]
|
||||
|
||||
resolve = {
|
||||
"sender": ["messages", 0, "senderId"],
|
||||
"message_id": ["messages", 0, "id"],
|
||||
#"username": ["profile", "username"],
|
||||
"message_body": ["messages", 0, "text"],
|
||||
"room_id": ["room_id"],
|
||||
#"location": ["profile", "location"],
|
||||
}
|
||||
keys = [
|
||||
{
|
||||
"keytitle": "msgtype",
|
||||
"keyvalue": "m.text",
|
||||
},
|
||||
{
|
||||
"keytitle": "body",
|
||||
"keyvalue": {
|
||||
"resolved": "message_body",
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
method = "PUT"
|
||||
|
||||
path = [
|
||||
"https://loxthelion.com/_matrix/client/v3/rooms/",
|
||||
{"resolved": "room_id"},
|
||||
"/send/m.room.message/",
|
||||
{"resolved": "message_id"},
|
||||
"?user_id=@rmass_",
|
||||
{"resolved": "sender"},
|
||||
":loxthelion.com",
|
||||
]
|
||||
|
||||
headers = {
|
||||
"Authorization": {
|
||||
"os": "AS_TOKEN",
|
||||
"prefix": "Bearer ",
|
||||
},
|
||||
"Content-Type": "application/json",
|
||||
}
|
||||
|
||||
#outputs = {
|
||||
# "room_id": "room_id",
|
||||
#}
|
||||
@@ -0,0 +1,49 @@
|
||||
import os
|
||||
|
||||
name = "Synapse User Registration"
|
||||
|
||||
kind = "action"
|
||||
|
||||
showstatus = True
|
||||
|
||||
astoken = os.environ["AS_TOKEN"]
|
||||
|
||||
resolve = {
|
||||
"sender": ["messages", 0, "senderId"],
|
||||
#"messageid": ["message", "id"],
|
||||
"username": ["profile", "username"],
|
||||
#"location": ["profile", "location"],
|
||||
}
|
||||
keys = [
|
||||
{
|
||||
"keytitle": "type",
|
||||
"keyvalue": "m.login.application_service",
|
||||
},
|
||||
{
|
||||
"keytitle": "username",
|
||||
"keyvalue": {
|
||||
"resolved": "sender",
|
||||
"prefix": "rmass_"
|
||||
},
|
||||
},
|
||||
{
|
||||
"keytitle": "inhibitlogin",
|
||||
"keyvalue": True,
|
||||
},
|
||||
]
|
||||
|
||||
method = "POST"
|
||||
|
||||
path = "https://loxthelion.com/_matrix/client/v3/register"
|
||||
|
||||
headers = {
|
||||
"Authorization": {
|
||||
"os": "AS_TOKEN",
|
||||
"prefix": "Bearer ",
|
||||
},
|
||||
"Content-Type": "application/json",
|
||||
}
|
||||
|
||||
outputs = {
|
||||
"user_id": "user_id",
|
||||
}
|
||||
Reference in New Issue
Block a user