From 8f721ee44ad64df567485b45f369c15d6b95dcc8 Mon Sep 17 00:00:00 2001 From: Lyncoln Date: Sun, 18 Oct 2026 00:18:04 -0400 Subject: [PATCH] Began work on synapse notification (currently disabled) --- plugins/rmass/actions/synapsenotify.py | 61 ++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 plugins/rmass/actions/synapsenotify.py 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", +} + +