diff --git a/plugins/rmass/actions/synapsenotify.py b/plugins/rmass/actions/synapsenotify.py new file mode 100644 index 0000000..eb54aac --- /dev/null +++ b/plugins/rmass/actions/synapsenotify.py @@ -0,0 +1,61 @@ +#import os + +name = "Synapse Message Error Notification" + +kind = "action" + +alias = "synapsemsgerrnotify" + +showstatus = True + +resolve = { + "get": { + "sender": ["room_name"], + "event_id": ["outmessageitem", "event_id"], + #"message_body": ["messageitem", "text"], + "room_id": ["outmessageitem", "room_id"], + #"timestamp": ["messageitem", "createdAt"], + }, + "deconstruct": { + "sender" : [ + "#rmass_dm_", + ":loxthelion.com", + ], + }, +} + +keys = [ + { + "keytitle": "msgtype", + "keyvalue": "m.notify", + }, + { + "keytitle": "body", + "keyvalue": "Message too short. should be more than 5 chars", + }, +] + +method = "PUT" + +path = [ + "https://loxthelion.com/_matrix/client/v3/rooms/", + {"resolved": "room_id"}, + "/send/m.room.message/", + {"resolved": "event_id"}, + "?user_id=@rmass_", + {"resolved": "sender"}, + ":loxthelion.com" + #"&ts=", + #{"resolved": "timestamp"}, + #"000" +] + +headers = { + "Authorization": { + "os": "AS_TOKEN", + "prefix": "Bearer ", + }, + "Content-Type": "application/json", +} + +