56 lines
1.0 KiB
Python
56 lines
1.0 KiB
Python
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",
|
|
#}
|